File tree Expand file tree Collapse file tree 4 files changed +24
-17
lines changed Expand file tree Collapse file tree 4 files changed +24
-17
lines changed Original file line number Diff line number Diff line change 16
16
17
17
jobs :
18
18
checks :
19
- name : Formatting and Linting
20
- runs-on : ubuntu-20 .04
19
+ name : Linting
20
+ runs-on : ubuntu-22 .04
21
21
steps :
22
+ - name : Checkout code
23
+ uses : actions/checkout@v3
22
24
- name : Setup Golang Environment
23
25
uses : actions/setup-go@v3
24
26
with :
25
- go-version : ' 1.15'
26
- - name : Checkout code
27
- uses : actions/checkout@v3
28
- - name : Lint code
29
- run : |
30
- make init
31
- make fmt
32
- make lint
27
+ go-version-file : go.mod
28
+ - name : Lint Code
29
+ uses : golangci/golangci-lint-action@v3
30
+ with :
31
+ only-new-issues : true
33
32
34
33
unit-tests :
35
34
name : Unit Tests
36
- runs-on : ubuntu-20 .04
35
+ runs-on : ubuntu-22 .04
37
36
needs : checks
38
37
steps :
39
38
- name : Checkout Repository
Original file line number Diff line number Diff line change 7
7
8
8
jobs :
9
9
release :
10
- runs-on : ubuntu-latest
10
+ runs-on : ubuntu-22.04
11
11
steps :
12
12
- uses : actions/checkout@v2
13
13
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ linters:
25
25
- golint
26
26
- maligned
27
27
- scopelint
28
+ # deprecated
29
+ - deadcode
30
+ - varcheck
31
+ - structcheck
32
+ - nosnakecase
28
33
29
34
30
35
# Run options
Original file line number Diff line number Diff line change @@ -34,27 +34,30 @@ deps-upgrade:
34
34
# ######################################
35
35
# # Tests, codegen, lint and format.
36
36
# ######################################
37
- fmt : $(info Running goimports...)
37
+ fmt :
38
+ $(info Running goimports...)
38
39
@goimports -w -e $$(find . -type f -name '*.go' -not -path "./vendor/*" )
39
40
40
- test : $(info Running unit tests...)
41
+ test :
42
+ $(info Running unit tests...)
41
43
mkdir -p $(RESULTS_DIR )
42
44
CGO_ENABLED=1 go test -race -v -cover ./... -coverprofile=$(RESULTS_DIR ) /$(PACKAGE ) -coverage.out 2>&1 | tee >( go-junit-report > $( RESULTS_DIR) /report.xml)
43
45
@echo " Total code coverage:"
44
46
@go tool cover -func=$(RESULTS_DIR ) /$(PACKAGE ) -coverage.out | grep ' total:' | tee $(RESULTS_DIR ) /anybadge.out
45
47
@go tool cover -html=$(RESULTS_DIR ) /$(PACKAGE ) -coverage.out -o $(RESULTS_DIR ) /coverage.html
46
48
47
- test-only-failed : $(info Running unit tests (showing only failed ones with context) ...)
49
+ test-only-failed :
50
+ $(info Running unit tests (showing only failed ones with context) ...)
48
51
go test -v -race ./... | grep --color -B 45 -A 5 -E ' ^FAIL.+'
49
52
50
53
$(LINT_BIN ) :
51
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.36.0
54
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2
52
55
53
56
lint : $(LINT_BIN )
54
57
$(LINT_BIN ) run
55
58
56
59
lint-docker :
57
- docker run --rm -v " ${PWD} " :/app -w /app golangci/golangci-lint:v1.36.0 golangci-lint run
60
+ docker run --rm -v " ${PWD} " :/app -w /app golangci/golangci-lint:v1.51.2 golangci-lint run
58
61
59
62
lint-shell :
60
63
shellcheck -x $$(find . -name "*.sh" -type f -not -path "./vendor/*" )
You can’t perform that action at this time.
0 commit comments