File tree 1 file changed +17
-10
lines changed
1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 21
21
- ' codecov.yml'
22
22
workflow_dispatch :
23
23
24
+ env :
25
+ # run static analysis, coverage and benchmarks only with the latest Go version
26
+ LATEST_GO_VERSION : 1.19
27
+
24
28
jobs :
25
29
test :
26
30
strategy :
@@ -47,23 +51,26 @@ jobs:
47
51
- name : Run Tests
48
52
run : go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
49
53
50
- - name : Install dependencies for checks
54
+ - name : Run golint
55
+ if : matrix.go == $LATEST_GO_VERSION
51
56
run : |
52
57
go install golang.org/x/lint/golint@latest
53
- go install honnef.co/go/tools/cmd/staticcheck@latest
54
- go install golang.org/x/vuln/cmd/govulncheck@latest
55
-
56
- - name : Run golint
57
- run : golint -set_exit_status ./...
58
+ golint -set_exit_status ./...
58
59
59
60
- name : Run staticcheck
60
- run : staticcheck ./...
61
+ if : matrix.go == $LATEST_GO_VERSION
62
+ run : |
63
+ go install honnef.co/go/tools/cmd/staticcheck@latest
64
+ staticcheck ./...
61
65
62
66
- name : Run govulncheck
63
- run : govulncheck ./...
67
+ if : matrix.go == $LATEST_GO_VERSION
68
+ run : |
69
+ go install golang.org/x/vuln/cmd/govulncheck@latest
70
+ govulncheck ./...
64
71
65
72
- name : Upload coverage to Codecov
66
- if : success() && matrix.go == 1.19 && matrix.os == 'ubuntu-latest'
73
+ if : success() && matrix.go == $LATEST_GO_VERSION && matrix.os == 'ubuntu-latest'
67
74
uses : codecov/codecov-action@v3
68
75
with :
69
76
token :
73
80
strategy :
74
81
matrix :
75
82
os : [ubuntu-latest]
76
- go : [1.19 ]
83
+ go : [$LATEST_GO_VERSION ]
77
84
name : Benchmark comparison ${{ matrix.os }} @ Go ${{ matrix.go }}
78
85
runs-on : ${{ matrix.os }}
79
86
steps :
You can’t perform that action at this time.
0 commit comments