Skip to content

ci: build and test against latest and latest-1 Go releases - #340

Merged
dmcgowan merged 1 commit into
containerd:mainfrom
dmcgowan:update-go-version
Oct 29, 2026
Merged

dmcgowan merged 1 commit into
containerd:mainfrom
dmcgowan:update-go-version

Conversation

@dmcgowan

Copy link
Copy Markdown
Member

CI was pinned to Go 1.22.x, which has been end-of-life for some time, and every new Go release required a manual bump in two workflows.

Use actions/setup-go's 'stable' and 'oldstable' selectors instead, so the test matrix always covers the latest Go release and the one before it with no ongoing maintenance. This follows the pattern already used by containerd/ttrpc and containerd/plugin. Jobs that only need a single Go version (project checks, linters, cross-compile, CodeQL) use 'stable'.

Also set GOTOOLCHAIN=local so that a go.mod requiring a newer toolchain than the installed one fails loudly instead of silently downloading it.

Tracking the latest Go release requires a linter that supports it, so move off golangci-lint v1.62.0, which is EOL and caps out well below the current Go release. Pin v2.12.2 and migrate .golangci.yml to the v2 schema:

  • gofmt and goimports are formatters in v2, not linters
  • govet, ineffassign, staticcheck and unused come from the default 'standard' set, so they no longer need to be listed
  • issues.exclude-rules moved to linters.exclusions.rules
  • the exclusion presets restore the default exclusions that v1 applied implicitly, keeping the effective linter behaviour unchanged

v2's staticcheck subsumes gosimple and stylecheck, which surfaces two new findings; fix both. Drop 'deadcode' from //nolint directives as that linter no longer exists.

Lint now runs in its own job rather than once per test matrix entry. This uses a prebuilt golangci-lint instead of compiling it from source in every job, which offsets the cost of doubling the test matrix.

Comment thread .github/workflows/ci.yml Resolved
CI was pinned to Go 1.22.x, which has been end-of-life for some time, and
every new Go release required a manual bump in two workflows.

Use actions/setup-go's 'stable' and 'oldstable' selectors instead, so the
test matrix always covers the latest Go release and the one before it with
no ongoing maintenance. This follows the pattern already used by
containerd/ttrpc and containerd/plugin. Jobs that only need a single Go
version (project checks, linters, cross-compile, CodeQL) use 'stable'.

Also set GOTOOLCHAIN=local so that a go.mod requiring a newer toolchain
than the installed one fails loudly instead of silently downloading it.

Tracking the latest Go release requires a linter that supports it, so move
off golangci-lint v1.62.0, which is EOL and caps out well below the current
Go release. Pin v2.12.2 and migrate .golangci.yml to the v2 schema:

  - gofmt and goimports are formatters in v2, not linters
  - govet, ineffassign, staticcheck and unused come from the default
    'standard' set, so they no longer need to be listed
  - issues.exclude-rules moved to linters.exclusions.rules
  - the exclusion presets restore the default exclusions that v1 applied
    implicitly, keeping the effective linter behaviour unchanged

v2's staticcheck subsumes gosimple and stylecheck, which surfaces two new
findings; fix both. Drop 'deadcode' from //nolint directives as that linter
no longer exists.

Lint now runs in its own job rather than once per test matrix entry. This
uses a prebuilt golangci-lint instead of compiling it from source in every
job, which offsets the cost of doubling the test matrix.

Signed-off-by: Derek McGowan <derek@mcg.dev>
@dmcgowan
dmcgowan force-pushed the update-go-version branch 2 times, most recently from edebe28 to efbb0b9 Compare October 29, 2026 22:33
@dmcgowan
dmcgowan merged commit ecefb61 into containerd:main Oct 29, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants