Skip to content

Adopt shared cache retention for CI build caches - #1481

Merged
chreekat merged 2 commits into
mainfrom
ci/shared-cache-retention
Nov 6, 2026
Merged

chreekat merged 2 commits into
mainfrom
ci/shared-cache-retention

Conversation

@fruffy

@fruffy fruffy commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adopt the shared p4lang/.github/CI/cache-retention action in a daily/manual maintenance workflow, with a manual dry-run option. Pin the same implementation revision used by PI (4bec527fd3988345ec240ae8f4f000bc938e4259).
  • Migrate native ccache and Bazel caches to ccache-v2- / bazel-v2- keys ending in main/PR scope, run ID, and attempt, as required by the shared retention policy. Successful builds save fresh caches; PRs restore their own compatible cache before falling back to main.
  • Scope Bazel caches and every fallback to runner image/version, architecture, and Bazel version, avoiding stale detected toolchains after runner upgrades.
  • Keep the newest main cache per logical key/version, remove duplicate and closed-PR entries, and target 2 GB of PR caches / 9 GB total storage. Document the cache lifecycle.

Legacy caches and Docker/BuildKit caches are outside the managed prefixes and remain subject to GitHub's normal expiration.

Uses the merged shared action from p4lang/.github#22. Companion adoptions: p4lang/PI#694 and p4lang/p4c#5922.

Use per-run main/PR keys for Bazel and ccache so the shared p4lang/.github retention action can prune stale entries. Scope Bazel restores to the runner image, architecture, and Bazel version.

Add scheduled maintenance and a manual dry-run option, pinned to the action revision in p4lang/.github#22 used by PI.

Signed-off-by: fruffy <fruffy@nyu.edu>
Signed-off-by: fruffy <fruffy@nyu.edu>
@chreekat
chreekat merged commit 56c0b2b into main Nov 6, 2026
11 checks passed
@chreekat
chreekat deleted the ci/shared-cache-retention branch November 6, 2026 06:25
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