Skip to content

sccache

sccache CI on GitHub Actions

sccache is configured but the hit rate is near zero in CI.

3% → 89%
Hit rate
18m → 4m
Build

sccache is configured but the hit rate is near zero in CI.

Why it happens

The sccache local directory is not persisted and no shared backend is configured.

What to change

  1. Point sccache at an S3 or Redis backend shared by all jobs
  2. Cache ~/.cache/sccache as a local fallback
  3. Check sccache --show-stats at the end of the job so misses are visible

sccache on runnerhut

yaml
jobs:
build:
runs-on: runnerhut-16vcpu-ubuntu-2404
env:
RUSTC_WRAPPER: sccache
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/sccache-action@v0.0.6
- run: cargo build --release
- run: sccache --show-stats
A working starting point

The only runnerhut-specific line is `runs-on: runnerhut-16vcpu-ubuntu-2404`. Everything else is standard GitHub Actions — the same actions, the same secrets and the same permissions model you use today.

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.