-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override the existing cache key #170
Comments
GitHub Action cache can be shared between branches. If a branch is created from main, then it can reuse cache from main. If a branch is created from branch dev, which is then created from main, then you can reuse cache from dev and main. |
I understand but this is based on the cache key. Currently when I specify a "shared-key" or "key" ex: with: the cache key ends up looking something like: which means that it is still using the hash of the cargo lock files which I dont want to do (I want to just have a common cache that is only updated by pushes to main but is always pulled in on all feature branches). I want the cache key to just be something like: |
I require this too, I want my pull requests to re-use the |
@KiraCoding If you modify cargo toolchain, cargo/rust envs, Cargo.toml/Cargo.lock, then rust-cache would restore cache from main and upload a new one to the branch. GHA has cache protection rules that forbidden PR/branches GHA run cache to be reused in main, though they can always reuse cache they are branched from. |
@cornelius-span That's probably a bug then |
I am trying to create essentially a common cache across multiple branches regardless of lockfile sum. In the documentation it is specified that the 'shared-key' field is:
A cache key that is used instead of the automatic
job
-based keyhowever when I specify a 'shared-key' the lock files and other parameters are still used in the cache key which results in many copies of the cache (which is quite large). I am wondering:
a) is it possible to fully specify the cache key
b) what is the preferred method for reusing a single cache across multiple branches with modifications.
I understand that this will probably slow down build times slightly because the incremental build will not be a perfect fit however it is preferable than rebuilding from scratch (and creating a ~2gb cache) each time a new branch is pushed
The text was updated successfully, but these errors were encountered: