Files
vectorcraft/.github/workflows/cache-prune.yml
T
dotCooCoo a70c571415 CI: a cold cache warm leg fits its timeout and the old rolling entry goes first
After Rust stable moved to 1.100.1, main's cache warm leg built cold
and was canceled at the 90-minute timeout with three steps still to
run, so no entry was saved and every leg stayed cold. The legs now get
150 minutes, and the cache prune watch runs for 160.

The nightly cold run restores nothing, so the old rolling entry and the
new one would be in the cache together while it saves, over the 10 GB
limit. A cold cache clear job deletes the old rolling entries when the
cache warm leg starts saving (scripts/ci-clear-rolling-cache.py). It
deletes nothing when the leg fails or is canceled, and fails itself so
that re-running the failed jobs runs it again with the leg.

cache-prune.yml prunes after every CI attempt on main, so a re-run of
the cache warm leg does not leave the entry it replaced in place.
2026-11-27 16:29:27 -08:00

36 lines
1.4 KiB
YAML

name: Cache prune
# A pass of the cache prune after every CI attempt on main. ci.yml's `cache prune` job prunes while
# a run's jobs save their entries, but "Re-run failed jobs" re-runs only the failed jobs: a re-run
# `cache warm` leg saves a new entry, and the prune job, which succeeded in the first attempt, does
# not run again. The entry it replaced would stay until the next main run, and with it the cache
# would be over its 10 GB budget, where GitHub evicts entries a run still needs. This runs once
# after every attempt, re-runs and canceled runs included (craft-common-actions actions/cache-prune).
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
permissions:
contents: read
jobs:
cache-prune:
name: cache prune
# A fork's pull request from a branch named main also matches `branches`.
if: github.event.workflow_run.event != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
permissions:
actions: write
steps:
- name: Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
# A failed pass warns; the next run's prune deletes what it missed.
- name: Prune replaced cache entries
uses: storytold/craft-common-actions/actions/cache-prune@main
continue-on-error: true