Skip to content

Add weekly cache warmer to keep SPM caches alive past 7-day TTL#149

Merged
obj-p merged 1 commit intomainfrom
chore/ci-cache-warmer
Apr 29, 2026
Merged

Add weekly cache warmer to keep SPM caches alive past 7-day TTL#149
obj-p merged 1 commit intomainfrom
chore/ci-cache-warmer

Conversation

@obj-p
Copy link
Copy Markdown
Owner

@obj-p obj-p commented Apr 29, 2026

Summary

  • Adds .github/workflows/cache-warm.yml, a small workflow that runs weekly (Sunday 05:00 UTC) plus on-demand via workflow_dispatch.
  • Mirrors ci.yml's two SPM cache keys — spm-macOS-build-{hash} and spm-macOS-ios-{hash} — by running each job's relevant swift build sequence, 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 tests step past its 30-min cap on slow GHA runners (see PR #141, where commit e7449f9'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_dispatch button 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

  • After merge, manually trigger via Actions → Cache warmer → "Run workflow" to confirm both jobs succeed and refresh both cache keys.
  • On the next regular CI run, confirm both Cache SPM build steps in ci.yml report Cache hit for: spm-macOS-build-… / spm-macOS-ios-….

🤖 Generated with Claude Code

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>
@obj-p obj-p merged commit 5be6797 into main Apr 29, 2026
4 checks passed
@obj-p obj-p deleted the chore/ci-cache-warmer branch April 29, 2026 22:14
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.

1 participant