feat: add save-cache option for PR-scoped build caching - #24
Merged
Conversation
Add 'save-cache' input to restore-jupyter-cache action. When enabled, uses actions/cache (instead of actions/cache/restore) which auto-saves the build directory at job end. The cache key includes github.run_id for uniqueness, and restore-keys prefix matching finds the most recent prior cache. GitHub Actions cache scoping ensures PR caches are isolated: - Caches from main are readable by all branches - Caches from a PR branch are only readable by that PR - No risk of PR caches affecting other PRs or main
This was referenced Aug 11, 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.
Add optional
save-cacheinput torestore-jupyter-cachefor PR-scoped build caching.Problem
When a PR author pushes a fix and the CI re-runs, the entire build re-executes from scratch (using only the weekly main cache as a starting point). This means every push to a PR triggers a full 10-20 minute build.
Solution
Add a
save-cache: 'true'option that switches fromactions/cache/restore(read-only) toactions/cache(restore + auto-save at job end). The cache key usesgithub.run_idfor uniqueness, andrestore-keysprefix matching finds the most recent prior cache.How it works
Cache isolation (GitHub Actions scoping)
main→ readable by all branches/PRsUsage
Backward compatible
Default is
save-cache: 'false'— existing workflows are unaffected.