Files
vectorcraft/.github/workflows/cache-prune.yml
T
dotCooCoo b851ac2c8d CI: drop the cache prune watcher job; cache-prune.yml prunes after each run
ci.yml's `cache prune` job held a runner beside the whole gate on every
main push and nightly run, only to delete the rolling entry that the
`cache warm` leg replaced. cache-prune.yml already runs that prune once
every CI attempt on main ends, and the warm leg is the last job to
finish, so the old entry now goes a few seconds after the save instead
of during it.

The nightly cold run's `cold cache clear` job stays. Its script used the
`cache prune` job to tell "Re-run all jobs" from a re-run of failed jobs.
It now looks for `gate / select legs` instead, which only "Re-run all
jobs" lists once the warm leg has succeeded, and it waits 5 minutes for
that job to appear before it treats the warm leg as finished in an
earlier attempt.
2026-11-30 05:16:23 -08:00

35 lines
1.2 KiB
YAML

name: Cache prune
# Keeps one rolling gate entry on main, so the repository stays within its 10 GB Actions cache
# budget, where GitHub evicts entries a run still needs. Each main CI attempt's `cache warm` leg
# saves a new rolling entry; this deletes the entry it replaced once the attempt ends. It runs once
# after every attempt, re-runs of failed jobs 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