zackees/zccache

Unified Rust compilation + dependency caching for GitHub Actions. Replaces both mozilla-actions/sccache-action and Swatinem/rust-cache with a single, faster action. ~1ms per warm cache hit vs ~170ms for sccache.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
cache-cargo-registryCache cargo registry index, downloaded crate files, and git dependencies. Replaces Swatinem/rust-cache registry caching. notrue
cache-compilationCache individual compilation units (.o/.rlib) via the zccache daemon. Replaces sccache. notrue
cache-targetCache 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. nofalse
target-snapshot-max-sizeMaximum target snapshot size after pruning. Supports B, KiB, MiB, and GiB suffixes. Set to "0" or "unlimited" to disable the size guard. no2GiB
target-snapshot-modeTarget 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. nohot
target-snapshot-too-largeBehavior when the target snapshot exceeds target-snapshot-max-size. Use "skip" to skip saving or "fail" to fail cleanup. noskip
target-prune-incrementalRemove target/**/incremental directories before creating a target snapshot. notrue
target-prune-build-script-outRemove target/**/build/*/out directories before creating a target snapshot. This can reclaim native build trees, but may force build scripts to rerun. nofalse
compilation-restore-fallbackWhether 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. notrue
target-restore-fallbackWhether 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. nofalse
target-dirPath to the cargo target directory. Default: ./target notarget
shared-keyAdditional key segment for cache isolation in matrix builds. Typically the Rust target triple (e.g., x86_64-unknown-linux-gnu). no""
zccache-versionVersion 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. nolatest
save-cacheWhether to save caches at the end. Set to "false" for PR builds where you only want to restore (saves GHA cache budget). notrue
namedescription
cache-hit-compilationWhether the zccache compilation cache was restored
cache-hit-registryWhether the cargo registry cache was restored
cache-hit-targetWhether the cargo target snapshot cache was restored