Skip to content

Commit 7c415cb

Browse files
committed
ci: bump actions and add gofmt/vet/build/govulncheck gates
Bumps actions/checkout to v7, actions/setup-go to v7, and codecov/codecov-action to v7. Adds strict gofmt, go mod tidy, go vet, build, and govulncheck checks to CI. Closes #17
1 parent 028b707 commit 7c415cb

1 file changed

Lines changed: 42 additions & 5 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
matrix:
1818
go-version: ["1.26", "1.26.5"]
1919
steps:
20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v7
2121

2222
- name: Set up Go ${{ matrix.go-version }}
23-
uses: actions/setup-go@v5
23+
uses: actions/setup-go@v7
2424
with:
2525
go-version: ${{ matrix.go-version }}
2626
cache: true
@@ -40,7 +40,7 @@ jobs:
4040

4141
- name: Upload coverage to Codecov
4242
if: matrix.go-version == '1.26.5'
43-
uses: codecov/codecov-action@v5
43+
uses: codecov/codecov-action@v7
4444
with:
4545
files: coverage-user.out,coverage-root.out
4646
token: ${{ secrets.CODECOV_TOKEN }}
@@ -50,16 +50,53 @@ jobs:
5050
name: Lint
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@v7
5454

5555
- name: Set up Go
56-
uses: actions/setup-go@v5
56+
uses: actions/setup-go@v7
5757
with:
5858
go-version: "1.26"
5959
cache: true
6060

61+
- name: Check gofmt
62+
run: |
63+
diff=$(gofmt -l .)
64+
if [ -n "$diff" ]; then
65+
echo "The following files are not gofmt-formatted:"
66+
echo "$diff"
67+
exit 1
68+
fi
69+
70+
- name: Verify go mod tidy
71+
run: |
72+
go mod tidy
73+
git diff --exit-code go.mod go.sum
74+
75+
- name: Run go vet
76+
run: go vet ./...
77+
78+
- name: Build
79+
run: go build ./...
80+
6181
- name: Run staticcheck
6282
uses: dominikh/staticcheck-action@v1
6383
with:
6484
version: latest
6585
install-go: false
86+
87+
govulncheck:
88+
name: Govulncheck
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v7
92+
93+
- name: Set up Go
94+
uses: actions/setup-go@v7
95+
with:
96+
go-version: "1.26"
97+
cache: true
98+
99+
- name: Run govulncheck
100+
run: |
101+
go install golang.org/x/vuln/cmd/govulncheck@latest
102+
govulncheck ./...

0 commit comments

Comments
 (0)