Skip to content

Commit eafcf93

Browse files
committed
fix CI syntax
1 parent 3f76804 commit eafcf93

File tree

2 files changed

+52
-40
lines changed

2 files changed

+52
-40
lines changed

.github/workflows/checks.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run checks
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read # to fetch code (actions/checkout)
14+
15+
env:
16+
# run static analysis, coverage and benchmarks only with the latest Go version
17+
LATEST_GO_VERSION: 1.19
18+
19+
jobs:
20+
check:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout Code
24+
uses: actions/checkout@v3
25+
26+
- name: Set up Go ${{ matrix.go }}
27+
uses: actions/setup-go@v3
28+
with:
29+
go-version: ${{ env.LATEST_GO_VERSION }}
30+
check-latest: true
31+
32+
- name: Run golint
33+
run: |
34+
go install golang.org/x/lint/golint@latest
35+
golint -set_exit_status ./...
36+
37+
- name: Run staticcheck
38+
run: |
39+
go install honnef.co/go/tools/cmd/staticcheck@latest
40+
staticcheck ./...
41+
42+
- name: Run govulncheck
43+
run: |
44+
go version
45+
go install golang.org/x/vuln/cmd/govulncheck@latest
46+
govulncheck ./...
47+
48+

.github/workflows/echo.yml

+4-40
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,16 @@ on:
44
push:
55
branches:
66
- master
7-
paths:
8-
- '**.go'
9-
- 'go.*'
10-
- '_fixture/**'
11-
- '.github/**'
12-
- 'codecov.yml'
137
pull_request:
148
branches:
159
- master
16-
paths:
17-
- '**.go'
18-
- 'go.*'
19-
- '_fixture/**'
20-
- '.github/**'
21-
- 'codecov.yml'
2210
workflow_dispatch:
2311

2412
permissions:
2513
contents: read # to fetch code (actions/checkout)
2614

27-
# NB: `env:` is not usable/visible in all yaml/workflow blocks
2815
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
3017
LATEST_GO_VERSION: 1.19
3118

3219
jobs:
@@ -44,8 +31,6 @@ jobs:
4431
steps:
4532
- name: Checkout Code
4633
uses: actions/checkout@v3
47-
with:
48-
ref: ${{ github.ref }}
4934

5035
- name: Set up Go ${{ matrix.go }}
5136
uses: actions/setup-go@v3
@@ -55,38 +40,17 @@ jobs:
5540
- name: Run Tests
5641
run: go test -race --coverprofile=coverage.coverprofile --covermode=atomic ./...
5742

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-
7743
- name: Upload coverage to Codecov
7844
if: success() && matrix.go == env.LATEST_GO_VERSION && matrix.os == 'ubuntu-latest'
7945
uses: codecov/codecov-action@v3
8046
with:
8147
token:
8248
fail_ci_if_error: false
49+
8350
benchmark:
8451
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
9054
steps:
9155
- name: Checkout Code (Previous)
9256
uses: actions/checkout@v3

0 commit comments

Comments
 (0)