ci: cache sccache local disk via actions/cache for hosted runners#376
Merged
streamer45 merged 1 commit intomainfrom Apr 25, 2026
Merged
ci: cache sccache local disk via actions/cache for hosted runners#376streamer45 merged 1 commit intomainfrom
streamer45 merged 1 commit intomainfrom
Conversation
Restore and save ~/.cache/sccache as a single GHA cache entry per Cargo.lock revision. This gives hosted runners compilation-level cache hits without the per-artifact entry explosion caused by SCCACHE_GHA_ENABLED (reverted in #373). Strategy: - actions/cache/restore before sccache-action starts (all hosted jobs) - actions/cache/save at end of job, main-branch only (if: always()) - Self-hosted GPU jobs skipped — they already have persistent disk cache - Plugins use a separate cache key prefix (sccache-plugins-*) Closes #374 Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Contributor
Author
|
✅ Reviewed on |
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Cache sccache's local disk directory (
~/.cache/sccache) as a single GitHub Actions cache entry, giving hosted runners compilation-level cache hits without the per-artifact entry explosion caused bySCCACHE_GHA_ENABLED(reverted in #373).How it works:
actions/cache/restoreruns beforesccache-action— pre-populates the local sccache directory from a prior main-branch runactions/cache/saveruns at end of job, main-branch only (if: always() && github.ref == 'refs/heads/main')Cache key strategy:
sccache-{os}-{Cargo.lock hash}withrestore-keys: sccache-{os}-for partial matchessccache-plugins-{os}-{plugins/**/Cargo.lock hash}to avoid key collisionThis creates 1 cache entry (vs ~1000 with
SCCACHE_GHA_ENABLED) and complementsSwatinem/rust-cache— rust-cache handles thetarget/directory (linking artifacts, incremental state), sccache handles individual compilation output.Closes #374
Review & Testing Checklist for Human
Cache not foundfor sccache (expected — no main-branch entry yet) and sccache stats show 0% hit rateSccache statspost-step frommozilla-actions/sccache-action)sccache-Linux-*entries (not hundreds)Notes
github.refcheck) since they only run on tags/dispatch respectivelyLink to Devin session: https://staging.itsdev.in/sessions/cdf841e834eb419aa04168a565311f10
Requested by: @streamer45