fix(ci): improve ccache persistence across builds #128

Merged
forbes merged 2 commits from fix/ci-cache-strategy into main 2026-02-10 12:58:21 +00:00

2 Commits

Author SHA1 Message Date
f7f44414ef Merge branch 'main' into fix/ci-cache-strategy
All checks were successful
Build and Test / build (pull_request) Successful in 40m34s
2026-02-10 12:58:09 +00:00
forbes
dfc32cabd6 fix(ci): fix ccache 0% hit rate and improve cache persistence
All checks were successful
Build and Test / build (pull_request) Successful in 1h16m6s
Root cause: compiler_check=mtime (default) invalidates the entire
cache on every run because pixi installs fresh compiler binaries with
new mtimes each time. The CI logs confirm 0/2579 cache hits (0.00%)
despite successfully restoring a 225MB cache.

Fix: set CCACHE_COMPILERCHECK=content to hash compiler binary content
instead of mtime. Same compiler version = same content = cache hits.

Also fix cache save strategy: use github.run_id for save keys so every
build persists its ccache objects. Previously date-based keys with
cache-hit guard meant the cache was only saved once per day — all
subsequent compilations were thrown away.

Changes:
- Add CCACHE_COMPILERCHECK=content to build.yml, release.yml, build.sh
- Use github.run_id in cache save keys (unique per run = always saves)
- Remove date-based cache key computation step
- Remove cache-hit != true guard on save step
- Add ccache-build-main- fallback to release workflow restore-keys
2026-02-09 18:04:17 -06:00