mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-29 21:40:01 +00:00
new: Add cache base warmup strategy. (#16)
This commit is contained in:
parent
c15c42022b
commit
c91b4202a2
11 changed files with 177 additions and 86 deletions
19
README.md
19
README.md
|
@ -22,6 +22,8 @@ optional.
|
|||
|
||||
- `bins` - Comma-separated list of global binaries to install into Cargo.
|
||||
- `cache` - Toggle caching of directories. Defaults to `true`.
|
||||
- `cache-base` - Base branch/ref to save a warmup cache on. Other branches/refs will restore from
|
||||
this base.
|
||||
- `cache-target` - Name of the target profile to cache. Defaults to `debug`.
|
||||
- `channel` - Toolchain specification/channel to explicitly install.
|
||||
- `components` - Comma-separated list of additional components to install.
|
||||
|
@ -135,6 +137,23 @@ The following optimizations and considerations are taken into account when cachi
|
|||
> The following sources are hashed for the generated cache key: `$GITHUB_JOB`, `Cargo.lock`, Rust
|
||||
> version, Rust commit hash, and OS.
|
||||
|
||||
### Warmup strategy
|
||||
|
||||
Another strategy that we support is called a warmup cache, where a base branch/ref is used to
|
||||
generate and save the cache (like master), and all other branches/refs will _only_ restore this
|
||||
cache (and not save).
|
||||
|
||||
This can be enabled with the `cache-base` input, which requires a branch/ref name. This input also
|
||||
supports regex.
|
||||
|
||||
```yaml
|
||||
- uses: moonrepo/setup-rust@v1
|
||||
with:
|
||||
cache-base: master
|
||||
# With regex
|
||||
cache-base: (master|main|develop)
|
||||
```
|
||||
|
||||
## Compared to
|
||||
|
||||
### `actions-rs/*`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue