| cache-cargo-registry | Cache cargo registry index, downloaded crate files, and git dependencies. Replaces Swatinem/rust-cache registry caching.
| no | true |
| cache-compilation | Cache individual compilation units (.o/.rlib) via the zccache daemon. Replaces sccache.
| no | true |
| cache-target | Cache a target/ snapshot (excluding incremental/) and run zccache warm. Allows cargo to skip invoking rustc entirely on warm builds. Disabled by default because Cargo target directories can grow to multi-GB snapshots.
| no | false |
| target-snapshot-max-size | Maximum target snapshot size after pruning. Supports B, KiB, MiB, and GiB suffixes. Set to "0" or "unlimited" to disable the size guard.
| no | 2GiB |
| target-snapshot-mode | Target snapshot mode when cache-target is true. "hot" saves Cargo metadata plus files read or modified during the job using atime/mtime checks. "full" saves the pruned target tree.
| no | hot |
| target-snapshot-too-large | Behavior when the target snapshot exceeds target-snapshot-max-size. Use "skip" to skip saving or "fail" to fail cleanup.
| no | skip |
| target-prune-incremental | Remove target/**/incremental directories before creating a target snapshot.
| no | true |
| target-prune-build-script-out | Remove target/**/build/*/out directories before creating a target snapshot. This can reclaim native build trees, but may force build scripts to rerun.
| no | false |
| compilation-restore-fallback | Whether restore-key fallback is allowed for the zccache compilation cache. Keep "true" for faster incremental CI across commits. Set to "false" for exact-key-only restores.
| no | true |
| target-restore-fallback | Whether restore-key fallback is allowed for cargo target snapshots. Default "false" because fallback snapshots can be stale for changed source trees, especially on pull_request merge refs.
| no | false |
| target-dir | Path to the cargo target directory. Default: ./target
| no | target |
| shared-key | Additional key segment for cache isolation in matrix builds. Typically the Rust target triple (e.g., x86_64-unknown-linux-gnu).
| no | "" |
| zccache-version | Version of zccache to install. Use "latest" for the newest release, a specific version like "1.2.5", or "source" to build the checked-out repository version.
| no | latest |
| save-cache | Whether to save caches at the end. Set to "false" for PR builds where you only want to restore (saves GHA cache budget).
| no | true |