leafwing-studios/Cargo Cache
Cache cargo build files and the registry
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Maintainedlast commit Oct 29, 2025
- License
- Apache 2.0
Pinned Snippet
uses: leafwing-studios/cargo-cache@ba6ee760ccdefa26b630cff8094e3243ae86a2c9 # v2.6.1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| cache-group | The 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-home | The 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-dir | The 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. | no | target |
| manifest-path | The path to `Cargo.toml`. This is used to determine where `Cargo.toml` and `Cargo.lock` are, which are used in the cache key. | no | Cargo.toml |
| save-always | This 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-if | Determines if the cache should be saved, or only loaded. Setting this to `false` will prevent new caches from being created. | no | true |
| sweep-cache | Automatically 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. | no | false |
| cache-cargo-sweep | This input has been deprecated and will be removed in v3.0.0. It has no effect. | no | — |
Outputs
| name | description |
|---|---|
| cache-hit | A string value that indicates if an exact match was found for the key. This is passed through from the `actions/cache` action. |