Skip to content

Commit 93a2978

Browse files
committed
ci: add Go version matrix and staticcheck job
- test job: run on Go 1.24.x (go.mod minimum), 1.25.x, 1.26.x. Catches stdlib behavior drift earlier than a single-version run. fail-fast off so a single version's failure does not mask other versions. - staticcheck job: pinned to go.mod version, runs honnef.co/go/tools across the module. Catches unused params, redundant conversions, and suspicious patterns that go vet ignores. Currently clean. bench-compare job left unchanged (still PR-only, informational).
1 parent c1a18fb commit 93a2978

1 file changed

Lines changed: 35 additions & 3 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,24 @@ permissions:
1111

1212
jobs:
1313
test:
14-
name: Go tests
14+
name: Go tests (${{ matrix.go }})
1515
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
# Cover the version pinned by go.mod and the two newer stable
20+
# releases. Drop or bump as new Go versions ship; never go below
21+
# the go.mod minimum.
22+
go: ['1.24.x', '1.25.x', '1.26.x']
1623

1724
steps:
1825
- name: Check out repository
1926
uses: actions/checkout@v5
2027

21-
- name: Set up Go
28+
- name: Set up Go ${{ matrix.go }}
2229
uses: actions/setup-go@v6
2330
with:
24-
go-version-file: go.mod
31+
go-version: ${{ matrix.go }}
2532
cache-dependency-path: go.sum
2633

2734
- name: Run default tests
@@ -33,6 +40,31 @@ jobs:
3340
- name: Run compatibility fixtures
3441
run: make compat-test
3542

43+
staticcheck:
44+
name: staticcheck
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Check out repository
49+
uses: actions/checkout@v5
50+
51+
- name: Set up Go
52+
uses: actions/setup-go@v6
53+
with:
54+
go-version-file: go.mod
55+
cache-dependency-path: go.sum
56+
57+
# Run honnef.co/go/tools/cmd/staticcheck against the whole module.
58+
# staticcheck catches issues vet doesn't (unused params, redundant
59+
# type conversions, dead code, suspicious patterns) and is the de
60+
# facto Go linter beyond go vet.
61+
- name: Install staticcheck
62+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
63+
64+
- name: Run staticcheck
65+
run: $(go env GOPATH)/bin/staticcheck ./...
66+
67+
3668
fuzz:
3769
name: Fuzz smoke
3870
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)