Skip to content

Fix poisoned Go cache in CI - #395

Merged
johnmaguire merged 1 commit into
mainfrom
go-ci-cache
Aug 3, 2026
Merged

Fix poisoned Go cache in CI#395
johnmaguire merged 1 commit into
mainfrom
go-ci-cache

Conversation

@johnmaguire

@johnmaguire johnmaguire commented Aug 3, 2026

Copy link
Copy Markdown
Member

No description provided.

setup-go's built-in cache keys on go version + nebula/go.sum alone, so
gofmt, gotest, smoke, and release all compute the same per-OS key.
Caches are immutable and first-save-wins, and gofmt finishes first on
Linux, so gotest restores a goimports-only cache and compiles the
nebula tree cold each run (the current Linux entry is 27 MiB next to a
232 MiB macOS one).

Disable the built-in cache and give gotest and the smoke jobs explicit
caches with per-job, per-commit keys (a fresh cache including GOCACHE
saves every run, with restore-keys warming from the previous commit)
and gofmt a static per-workflow key. Tag-triggered release runs get no
cache.
@johnmaguire
johnmaguire marked this pull request as ready for review August 3, 2026 21:19

@jasikpark jasikpark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Faithful extension of api#2220's Go-cache fix to this repo's shape (4 workflows, 5 setup-go call sites). Verified: distinct cache-key prefixes per job (gofmt-go-/gotest-go-/smoke-android-go-/smoke-ios-go-, no collisions), OS-correct build-cache paths (~/.cache/go-build on ubuntu, ~/Library/Caches/go-build on macos runners), and release.yml deliberately drops to no-cache (cache: false, no restore) rather than racing the shared key — reasonable given it only runs on version-tag pushes. fluttercheck.yml/swiftfmt.yml correctly left untouched, neither uses setup-go. CI green across gofmt, Go tests, and both smoke builds.

@johnmaguire
johnmaguire merged commit c9bef19 into main Aug 3, 2026
5 checks passed
@johnmaguire
johnmaguire deleted the go-ci-cache branch August 3, 2026 21:26
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