mirror of
https://github.com/actions-rust-lang/setup-rust-toolchain.git
synced 2024-12-26 00:52:17 +01:00
Add support for adding to cache key
When using this action in multiple matrix jobs in the same workflow, the generated cache key is the same for all of them, because they all get the same job ID. This means that all apart from the first job are unable to save the cache, and subsequent runs might restore the wrong cache. The `Swatinem/rust-cache` action which we use for caching has a `key` input which it puts in its cache key. (It doesn't override the key, just adds to it.) Providing this as an input here will allow us to generate a unique cache key for each job in the matrix.
This commit is contained in:
parent
1fbea72663
commit
b01657d9bb
2 changed files with 5 additions and 0 deletions
|
@ -56,6 +56,7 @@ Afterward, the `components` and `target` specified via inputs are installed in a
|
|||
| `cache` | Automatically configure Rust cache (using [`Swatinem/rust-cache`]) | true |
|
||||
| `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | |
|
||||
| `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true |
|
||||
| `key` | Propagates the value to [`Swatinem/rust-cache`] | |
|
||||
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
|
||||
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
|
||||
|
||||
|
|
|
@ -32,6 +32,9 @@ inputs:
|
|||
description: "Also cache on workflow failures"
|
||||
default: "true"
|
||||
required: false
|
||||
cache-key:
|
||||
description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs."
|
||||
required: false
|
||||
matcher:
|
||||
description: "Enable the Rust problem matcher"
|
||||
required: false
|
||||
|
@ -181,3 +184,4 @@ runs:
|
|||
with:
|
||||
workspaces: ${{inputs.cache-workspaces}}
|
||||
cache-on-failure: ${{inputs.cache-on-failure}}
|
||||
key: ${{inputs.cache-key}}
|
||||
|
|
Loading…
Reference in a new issue