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 1616
1717jobs :
1818 checks :
19- name : Formatting and Linting
20- runs-on : ubuntu-20 .04
19+ name : Linting
20+ runs-on : ubuntu-22 .04
2121 steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v3
2224 - name : Setup Golang Environment
2325 uses : actions/setup-go@v3
2426 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
3332
3433 unit-tests :
3534 name : Unit Tests
36- runs-on : ubuntu-20 .04
35+ runs-on : ubuntu-22 .04
3736 needs : checks
3837 steps :
3938 - name : Checkout Repository
Original file line number Diff line number Diff line change 77
88jobs :
99 release :
10- runs-on : ubuntu-latest
10+ runs-on : ubuntu-22.04
1111 steps :
1212 - uses : actions/checkout@v2
1313
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ linters:
2525 - golint
2626 - maligned
2727 - scopelint
28+ # deprecated
29+ - deadcode
30+ - varcheck
31+ - structcheck
32+ - nosnakecase
2833
2934
3035# Run options
Original file line number Diff line number Diff line change @@ -34,27 +34,30 @@ deps-upgrade:
3434# ######################################
3535# # Tests, codegen, lint and format.
3636# ######################################
37- fmt : $(info Running goimports...)
37+ fmt :
38+ $(info Running goimports...)
3839 @goimports -w -e $$(find . -type f -name '*.go' -not -path "./vendor/*" )
3940
40- test : $(info Running unit tests...)
41+ test :
42+ $(info Running unit tests...)
4143 mkdir -p $(RESULTS_DIR )
4244 CGO_ENABLED=1 go test -race -v -cover ./... -coverprofile=$(RESULTS_DIR ) /$(PACKAGE ) -coverage.out 2>&1 | tee >( go-junit-report > $( RESULTS_DIR) /report.xml)
4345 @echo " Total code coverage:"
4446 @go tool cover -func=$(RESULTS_DIR ) /$(PACKAGE ) -coverage.out | grep ' total:' | tee $(RESULTS_DIR ) /anybadge.out
4547 @go tool cover -html=$(RESULTS_DIR ) /$(PACKAGE ) -coverage.out -o $(RESULTS_DIR ) /coverage.html
4648
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) ...)
4851 go test -v -race ./... | grep --color -B 45 -A 5 -E ' ^FAIL.+'
4952
5053$(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
5255
5356lint : $(LINT_BIN )
5457 $(LINT_BIN ) run
5558
5659lint-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
5861
5962lint-shell :
6063 shellcheck -x $$(find . -name "*.sh" -type f -not -path "./vendor/*" )
You can’t perform that action at this time.
0 commit comments