4
4
push :
5
5
branches :
6
6
- master
7
- paths :
8
- - ' **.go'
9
- - ' go.*'
10
- - ' _fixture/**'
11
- - ' .github/**'
12
- - ' codecov.yml'
13
7
pull_request :
14
8
branches :
15
9
- master
16
- paths :
17
- - ' **.go'
18
- - ' go.*'
19
- - ' _fixture/**'
20
- - ' .github/**'
21
- - ' codecov.yml'
22
10
workflow_dispatch :
23
11
24
12
permissions :
25
13
contents : read # to fetch code (actions/checkout)
26
14
27
- # NB: `env:` is not usable/visible in all yaml/workflow blocks
28
15
env :
29
- # run static analysis, coverage and benchmarks only with the latest Go version
16
+ # run coverage and benchmarks only with the latest Go version
30
17
LATEST_GO_VERSION : 1.19
31
18
32
19
jobs :
44
31
steps :
45
32
- name : Checkout Code
46
33
uses : actions/checkout@v3
47
- with :
48
- ref : ${{ github.ref }}
49
34
50
35
- name : Set up Go ${{ matrix.go }}
51
36
uses : actions/setup-go@v3
@@ -55,38 +40,17 @@ jobs:
55
40
- name : Run Tests
56
41
run : go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
57
42
58
- - name : Run golint
59
- if : matrix.go == env.LATEST_GO_VERSION
60
- run : |
61
- echo "env.LATEST_GO_VERSION=${{ env.LATEST_GO_VERSION }} matrix.go=${{ matrix.go }}"
62
- go install golang.org/x/lint/golint@latest
63
- golint -set_exit_status ./...
64
-
65
- - name : Run staticcheck
66
- if : matrix.go == env.LATEST_GO_VERSION
67
- run : |
68
- go install honnef.co/go/tools/cmd/staticcheck@latest
69
- staticcheck ./...
70
-
71
- - name : Run govulncheck
72
- if : matrix.go == env.LATEST_GO_VERSION
73
- run : |
74
- go install golang.org/x/vuln/cmd/govulncheck@latest
75
- govulncheck ./...
76
-
77
43
- name : Upload coverage to Codecov
78
44
if : success() && matrix.go == env.LATEST_GO_VERSION && matrix.os == 'ubuntu-latest'
79
45
uses : codecov/codecov-action@v3
80
46
with :
81
47
token :
82
48
fail_ci_if_error : false
49
+
83
50
benchmark :
84
51
needs : test
85
- strategy :
86
- matrix :
87
- os : [ubuntu-latest]
88
- name : Benchmark comparison ${{ matrix.os }}
89
- runs-on : ${{ matrix.os }}
52
+ name : Benchmark comparison
53
+ runs-on : ubuntu-latest
90
54
steps :
91
55
- name : Checkout Code (Previous)
92
56
uses : actions/checkout@v3
0 commit comments