Ray's Knowledge Base
Unlock

CI that saves ccache only on pushes to the default branch leaves every PR run cold when that cache is evicted

FactVerified 8 Oct 2026Holds project: dftracer-utils
Fact. A statement and the evidence for it.

Statement#

In dftracer-utils ci.yml, every "Save ccache" and "Drop older ccache copies" step runs only for github.event_name == 'push' on the default branch (lines near 318, 470, 579, 701 and 820). A PR run restores the newest default-branch ccache and never saves one. gh cache list --repo <owner>/<repo> --json key,sizeInBytes,ref showed 32 entries and 6.6 GB of the 10 GB quota, and none of them was a ccache entry, so every job built cold. Saving ccache from PRs is risky: about 10 ccache keys at up to 1 GB each, saved per PR ref, would overflow the 10 GB repository quota and evict the default branch's caches. Better plans: save only on the default branch, delete duplicate cpmsource entries (350 to 415 MB each, keyed by a hash of Dependencies.cmake), lower CCACHE_MAXSIZE, or use a store outside GitHub such as sccache on S3.

Evidence#

Measured with gh cache list and gh api repos/<owner>/<repo>/actions/cache/usage (32 caches, 6.6 GB). A full CI run of the branch cost 986 runner-minutes: 21 wheel jobs 731 minutes (slowest 60), 10 Valgrind jobs 172, 4 test jobs 83. The cause of the missing ccache entries was not proven. Eviction by size, the 7-day limit, or cancelled runs are all possible.

Also found by searching

  • why is every CI job building from scratch, ccache never hits
  • gh cache list shows no ccache entries
  • should pull request runs save ccache to the GitHub Actions cache
  • wheel build jobs take 50 minutes on every push