Skip to content

fix(ci): read Go version from go.mod instead of hardcoded matrix - #252

Merged
marcusburghardt merged 1 commit into
complytime:mainfrom
marcusburghardt:fix/ci-go-version-from-gomod
Sep 9, 2026
Merged

marcusburghardt merged 1 commit into
complytime:mainfrom
marcusburghardt:fix/ci-go-version-from-gomod

Conversation

@marcusburghardt

Copy link
Copy Markdown
Member

Summary

Replace the hardcoded go-version matrix ('1.26') in ci_local.yml with go-version-file: 'go.mod' so that setup-go installs the exact patch version declared in the module directive, downloading it from go.dev if it is not yet in the runner toolcache.

Problem

Renovate PR #239 bumps the go directive in go.mod from 1.26.5 to 1.26.8. The CI workflow uses go-version: '1.26', which resolves to whatever patch is cached on the GitHub Actions runner (currently 1.26.7). Because setup-go v7 sets GOTOOLCHAIN=local, Go refuses to build when the running version (1.26.7) is older than what go.mod requires (1.26.8):

go: go.mod requires go >= 1.26.8 (running go 1.26.7; GOTOOLCHAIN=local)

This will recur on every Renovate Go patch bump where the runner toolcache lags behind go.dev releases.

Changes

  • Remove single-entry strategy matrix (go-version: ['1.26']) — it served only to parameterize the Go version and had a single entry.
  • Switch setup-go input from go-version: ${{ matrix.go-version }} to go-version-file: 'go.mod' — setup-go v7 reads the go directive and downloads the exact patch version if needed.
  • Remove if: matrix.go-version == '1.26' on the Coverage step — with no matrix, coverage runs unconditionally (same behavior as before since the matrix had only one entry).

Notes

  • The CI job display name changes from Test (1.26) to Test (no matrix suffix). No branch protection rules reference the old name.
  • The module-sync job is unchanged.
  • Once this merges, Renovate PR chore(deps): Update go module directive to v1.26.8 #239 can be rebased and its CI should pass.

Assisted-by: OpenCode (claude-opus-4-6)

Replace the hardcoded go-version matrix ('1.26') with
go-version-file: 'go.mod' so setup-go installs the exact patch
version declared in the module directive. This prevents CI failures
when Renovate bumps the Go patch version before the GitHub Actions
runner toolcache includes that release.

Changes:
- Remove single-entry strategy matrix (go-version: ['1.26'])
- Switch setup-go input from go-version to go-version-file: 'go.mod'
- Remove matrix-conditional if on the Coverage step

Resolves the Test (1.26) CI failure on PR complytime#239 where go.mod requires
go >= 1.26.8 but the runner only had 1.26.7 with GOTOOLCHAIN=local.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt
marcusburghardt requested a review from a team as a code owner September 9, 2026 07:59
@marcusburghardt marcusburghardt moved this from Backlog to Ready for Review 👀 in ComplyTime planning Sep 9, 2026
@marcusburghardt marcusburghardt added github_actions Pull requests that update GitHub Actions code test labels Sep 9, 2026

@sonupreetam sonupreetam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcusburghardt
marcusburghardt merged commit 69e8a86 into complytime:main Sep 9, 2026
14 checks passed
@marcusburghardt
marcusburghardt deleted the fix/ci-go-version-from-gomod branch September 9, 2026 10:49
@github-project-automation github-project-automation Bot moved this from Ready for Review 👀 to Done ✔️ in ComplyTime planning Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code test

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

2 participants