swatinem/Rust Cache

A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
prefix-keyThe prefix cache key, this can be changed to start a new cache manually.nov0-rust
shared-keyA cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs.no
keyAn additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs.no
add-job-id-keyIf the automatic `job`-based cache key should include the job id. Defaults to true.notrue
add-rust-environment-hash-keyWeather the a hash of the rust environment should be included in the cache key. This includes a hash of all Cargo.toml/Cargo.lock files, rust-toolchain files, and .cargo/config.toml files (if present), as well as the specified 'env-vars'. Defaults to true.notrue
env-varsAdditional environment variables to include in the cache key, separated by spaces.no
workspacesPaths to multiple Cargo workspaces and their target directories, separated by newlines.no
cache-directoriesAdditional non workspace directories to be cached, separated by newlines.no
cache-targetsDetermines whether workspace targets are cached. If `false`, only the cargo registry will be cached.notrue
cache-on-failureCache even if the build fails. Defaults to false.no
cache-all-cratesDetermines which crates are cached. If `true` all crates will be cached, otherwise only dependent crates will be cached.nofalse
cache-workspace-cratesSimilar to cache-all-crates. If `true` the workspace crates will be cached.nofalse
save-ifDeterminers whether the cache should be saved. If `false`, the cache is only restored.notrue
cache-providerDetermines which provider to use for caching. Options are github, or warpbuild. Defaults to github.nogithub
cache-binDetermines whether to cache ${CARGO_HOME}/bin.notrue
lookup-onlyCheck if a cache entry exists without downloading the cachenofalse
cmd-formatA format string used to format commands to be run, i.e. `rustc` and `cargo`.no{0}
namedescription
cache-hitA boolean value that indicates an exact match was found.