ci: create cache always in main, skip saving cache in PRs #10560
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.
This PR improves the CI cache in the following ways:
./target
cache (The cache key hasgithub.sha
at the end)With this change, main branch always creates fresh cache and PR branches can use the latest one. So the PR branch's build amount should be consistently minimal.
Note1: This change prevents the false detection of stale files, which, for example, happened in this run https://github.com/denoland/deno/runs/2462335233 where only one markdown file was changed, but 45 files were considered 'stale' at mtime restore step.
Note2: This PR uses
actions/cache@03e00da99d75a2204924908e1cca7902cafce66b
which is the merge head of actions/cache#489 . cfgit ls-remote https://github.com/actions/cache.git | grep 489/merge