Allow opting out of caching $CARGO_HOME/bin. (#216)

Prevents wiping the bin directory, which is harmful for
self-hosted runners.
This commit is contained in:
Benjy Weinberger
2024-12-09 23:47:51 -08:00
committed by GitHub
parent 9a2e0d3212
commit e8e63cdbf2
6 changed files with 59 additions and 15 deletions

View File

@ -79,6 +79,10 @@ sensible defaults.
# Can be set to either "github" or "buildjet"
# default: "github"
cache-provider: ""
# Determines whether to cache the ~/.cargo/bin directory.
# default: "true"
cache-bin: ""
```
Further examples are available in the [.github/workflows](./.github/workflows/) directory.
@ -175,4 +179,7 @@ to see those details as well as further details related to caching operations.
## Known issues
- The cache cleaning process currently removes all the files from `~/.cargo/bin`
that were present before the action ran (for example `rustc`).
that were present before the action ran (for example `rustc`), by default.
This can be an issue on long-running self-hosted runners, where such state
is expected to be preserved across runs. You can work around this by setting
`cache-bin: "false"`.