ci: seed shared Rust caches from main#1530
Merged
Merged
Conversation
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com> # Conflicts: # .github/workflows/branch-checks.yml
Collaborator
Author
|
I validated that the cache is now available on a fresh branch, after the cache was seeded on Both Rust jobs restored full-match caches from the main-seeded keys:
Compared with the original cache-miss runs, Branch Checks dropped from ~8m 20-30s to 4m 49s. Rust jobs dropped from ~6m 40s-7m 30s to ~3m 15s-4m 10s. The remaining fixed cost is mostly container initialization. Since our runner infra is ephemeral, each job needs to pull the ci image, we could optimize that image, etc. to speed that up in the future. |
TaylorMutch
approved these changes
May 22, 2026
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
Branch Checks were producing identical Rust cache restore keys across different
pull-request/*branches, but GitHub Actions cache lookup is ref-scoped. That means a cache created on one PR branch is not visible to sibling PR branches, so first runs on new PR branches can miss even when the printed restore key matches.This PR seeds the same Rust cache keys from
main, which GitHub exposes to branch/PR runs as a default-branch cache source. It also stops archiving.cache/sccachethroughSwatinem/rust-cachebecause sccache is already using the GitHub Actions backend directly.Related Issue
None.
Observed runs:
Changes
shared-keyand sccache namespace for seeded caches..cache/sccachefromSwatinem/rust-cache; sccache continues using the GHA backend directly.pull-request/*branch can still benefit from branch-local caches.cache-on-failurefor Branch Checks Rust cache saves.Testing
mise run pre-commitpassesChecklist