ci: keep the Go build cache current - #3139
Merged
Merged
Conversation
actions/setup-go keys its cache on the Go version and go.sum only. The first job to finish after a new Go release or a go.sum change saves the entry, and every later run hits that key and skips saving. Master CI is still restoring the entries saved on 2026-09-11 (Go 1.27.1), so everything that changed since then recompiles in every run. Replace it with actions/cache restore/save, keyed per OS, architecture, Go version and job. Each run restores the newest cache saved for its key prefix, and runs other than pull requests save a new entry for the commit, so the cache tracks master. Pull requests only restore, which keeps the repository's cache storage bounded. A full race build cache compresses to about 80 MB. Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
This was referenced Oct 1, 2026
Since #3140 the benchmark job runs only on pull requests, which never save a cache, so its restore would always miss. Claude-Session: https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
actions/setup-gokeys its cache on the Go version andgo.sumonly. The first job to finish after a new Go release or ago.sumchange saves the entry, and every later run hits that key and skips saving. Master CI is still restoring the entries saved on 2026-09-11 (Go 1.27.1, 54 MB on Linux), so everything that changed since then, including the router and middleware fixes in the September releases, recompiles in every run.This replaces it with
actions/cacherestore and save, keyed per OS, architecture, Go version and job:Measured on this branch with two manual runs (first run cold, second run restoring):
For reference, the Run Tests steps on master's last push run took 8–32 s with the September cache.
The benchmark job doesn't use the cache: since #3140 it runs only on pull requests, which never save one.
https://claude.ai/code/session_01QKDYQr53zNKkR7nif2CAAq