Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/ci: use actions/cache/restore for non-protected branch
CLs are tested by creating PRs in the cue-trybot repo. These PRs are created against branches that are pushed to the trybot repo. Such a PR trybot run will have a cache "miss" because the associated branch will never be known to the cue-trybot actions cache: each branch is unique to each CL+patchset. This is as expected. When such a PR fires the actions workflows, the use of actions/cache results in a cache miss for the branch associated with the PR, falling back to the target branch of the PR, per the GitHub docs: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key This is also as expected. However, the use of actions/cache for PRs (that are the result of CL runtrybot calls) also ends up writing the resulting cache back to a cache key associated with the branch of the PR. This is entirely wasteful, because that cache will never be used again (see previous point about branch being unique to CL+patchset). Writing back this cache is a waste of time and space. actions/cache/restore, as its name suggests, only restores from a cache and does not write back. This changes makes trybot runs that are not against a protected branch use actions/cache/restore, leaving the existing behaviour for the procted branches which is what we want. Signed-off-by: Paul Jolly <paul@myitcv.io> Change-Id: Iea6f37612ffd226db60b9e1a16b65503daebdaf2 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551249 Reviewed-by: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information