leafwing-studios/Cargo Cache

Cache cargo build files and the registry

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Maintainedlast commit Oct 29, 2025
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: leafwing-studios/cargo-cache@ba6ee760ccdefa26b630cff8094e3243ae86a2c9 # v2.6.1

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
cache-groupThe group of the cache, defaulting to a unique identifier for the workflow job. If you want two jobs to share the same cache, give them the same group name. no
cargo-homeThe location of the Cargo home directory. If you specify the `CARGO_HOME` env variable for your commands, you need to set it here too. This must *not* end with the trailing slash of the directory. no~/.cargo
cargo-target-dirThe location where Cargo places all generated artifacts, relative to the current working directory. If you specify the `CARGO_TARGET_DIR` environmental variable or `--target-dir` for your commands, you need to set it here as well. This must *not* end with the trailing slash of the directory. notarget
manifest-pathThe path to `Cargo.toml`. This is used to determine where `Cargo.toml` and `Cargo.lock` are, which are used in the cache key. noCargo.toml
save-alwaysThis input has been deprecated and will be removed in v3.0.0. It has no effect. This input used to specify the `save-always` input for `actions/cache`, but has been deprecated due to its unintended behavior. If you still require this input, you will need to manually use `actions/cache`. For more information, please see <https://github.com/actions/cache/tree/v4/save#always-save-cache>. no
save-ifDetermines if the cache should be saved, or only loaded. Setting this to `false` will prevent new caches from being created. notrue
sweep-cacheAutomatically delete files in the target folder that are not used between when this action is called and the end of the job. This can prevent the size of caches snowballing. Since old caches are used to create new caches, unused files can slowly pile up over time, causing larger caches and longer runtimes. nofalse
cache-cargo-sweepThis input has been deprecated and will be removed in v3.0.0. It has no effect. no
namedescription
cache-hitA string value that indicates if an exact match was found for the key. This is passed through from the `actions/cache` action.