Add weekly cache warmer to keep SPM caches alive past 7-day TTL#149
Merged
Add weekly cache warmer to keep SPM caches alive past 7-day TTL#149
Conversation
GitHub evicts cache entries 7 days after their last access. For branches that go quiet over a long weekend or holiday, the SPM build cache that ci.yml relies on can expire between PR pushes, forcing a cold rebuild that has been observed pushing the `MCP integration tests` step past its 30-min cap (PR #141). `cache-warm.yml` runs weekly Sunday 05:00 UTC and on `workflow_dispatch`, mirroring ci.yml's two cache keys — `spm-macOS-build-{hash}` and `spm-macOS-ios-{hash}` — by running the same `swift build` + `swift build --package-path examples/spm` sequence each job uses. Each job restores its key, builds, and the actions/cache post-step refreshes the cache content under the same key, resetting the eviction clock. Weekly + 7-day TTL is tight margin; the dispatch button on the Actions page is the safety valve for cases where a holiday delay or runner queue pushes the next scheduled fire past the eviction deadline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
.github/workflows/cache-warm.yml, a small workflow that runs weekly (Sunday 05:00 UTC) plus on-demand viaworkflow_dispatch.ci.yml's two SPM cache keys —spm-macOS-build-{hash}andspm-macOS-ios-{hash}— by running each job's relevantswift buildsequence, refreshing the cache content under the same key.Why
GitHub evicts cache entries 7 days after their last access. For branches that go quiet over a long weekend or holiday, the cache can expire between PR pushes, forcing a cold rebuild that has been observed pushing the
MCP integration testsstep past its 30-min cap on slow GHA runners (see PR #141, where commite7449f9's build-and-test took 2315s vs. the same workflow taking 470s a week earlier — empirically the cache hit cleanly that day, so the issue was runner variance, but cache expiry would have stacked badly on top).Weekly + 7-day TTL is tight margin; the
workflow_dispatchbutton on the Actions page is the manual safety valve if a holiday delay or runner queue pushes the next scheduled fire past the eviction deadline.Cost
~16 macos-15 GHA minutes per week (two parallel jobs, ~8 min each warm). Single-digit-percent of the project's CI budget.
Test plan
Cache SPM buildsteps inci.ymlreportCache hit for: spm-macOS-build-…/spm-macOS-ios-….🤖 Generated with Claude Code