Skip to content

Conversation

@wietzesuijker
Copy link
Contributor

@wietzesuijker wietzesuijker commented Feb 12, 2026

What does this PR do?

Add automatic cache cleanup to prevent the 10GB repo limit from evicting ccache entries.

Each CI run creates ~16 immutable cache entries (one per matrix job). Without cleanup, old entries accumulate until GitHub's LRU eviction wipes valuable ccache entries.

  1. cleanup-cache action - reusable composite action that deletes older entries with the same prefix on the same branch after each job saves its cache.
  2. cache_cleanup.yml - purges all caches when branches are deleted.
  3. Cleanup step added to linux_build, slow_tests, cmake_builds, android_cmake, macos.

Cache count bounded at ~16-20 per active branch.

Note: Requires actions: write permission for gh cache delete. Added only to workflows that use the cleanup step.

Tasklist

  • AI (Claude) supported my development of this PR
  • All CI builds and checks have passed

Replace github.run_id with github.sha in cache keys
(run_id creates new immutable entries every run, sha enables reuse)

Add 3-level restore-keys: base_ref, master, bare prefix
(PR builds can restore from master's cache on first push)
Cache referenced non-existent steps.get-date.outputs.today causing 100% miss rate.
Use hashFiles of conda recipe files with restore-keys for proper cache behavior.
@dbaston
Copy link
Member

dbaston commented Feb 12, 2026

I would have thought that letting GitHub remove the least-recently used cache entries is what we want. Can you help clarify why it isn't?

Each CI run creates ~16 immutable cache entries (one per matrix job).
Without cleanup, old entries accumulate until the 10GB repo limit
triggers LRU eviction of ccache entries.

Add reusable cleanup-cache action that each job calls after saving
its cache - deletes older entries with the same prefix on the same
branch. Add cache_cleanup.yml to purge all caches on branch deletion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants