mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-02 20:20:35 -05:00
The Windows gate has no dependency cache, so every Windows run compiles all 741 crates cold. A `cache warm (windows-latest)` leg now builds the tests and saves the entry as soon as the build succeeds, so a main whose Windows tests fail still seeds it. The call has a 120-minute limit for a cold run. cache-prune.yml deletes an entry once a newer one of its family replaces it.
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
name: Cache prune
|
|
|
|
# Keeps the repository inside its 10 GB Actions cache budget. A new Rust cache entry (a lockfile or
|
|
# toolchain change makes one) leaves its predecessor behind until GitHub evicts the least recently
|
|
# used entries, which can be one a run still needs. After each CI run on main, this deletes the
|
|
# entries a newer one of the same family replaced, once nothing has used them since (craft-common-actions
|
|
# actions/cache-prune). Other entries (apt packages, tool caches) stay.
|
|
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
|