Cache Cleanup #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cache Cleanup | |
| on: | |
| # Periodic GC keeps the repo under GitHub's 10 GiB cache cap so a fresh ccache | |
| # save never triggers LRU eviction of the build caches we want to keep. | |
| schedule: | |
| - cron: '17 */6 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to clean (leave empty for all branches)' | |
| required: false | |
| type: string | |
| dry-run: | |
| description: 'List caches without deleting' | |
| required: false | |
| type: boolean | |
| default: true | |
| mode: | |
| description: 'prune = keep ccache/cpm and evict the rest; wipe = delete all listed caches' | |
| required: false | |
| type: choice | |
| options: | |
| - prune | |
| - wipe | |
| default: prune | |
| permissions: | |
| contents: read | |
| jobs: | |
| scheduled-gc: | |
| if: github.event_name == 'schedule' | |
| permissions: | |
| actions: write | |
| uses: ./.github/workflows/_cache-cleanup.yml | |
| with: | |
| dry-run: false | |
| prune: true | |
| summary: true | |
| manual: | |
| if: github.event_name == 'workflow_dispatch' | |
| permissions: | |
| actions: write | |
| uses: ./.github/workflows/_cache-cleanup.yml | |
| with: | |
| branch: ${{ inputs.branch }} | |
| dry-run: ${{ inputs.dry-run }} | |
| prune: ${{ inputs.mode == 'prune' }} | |
| summary: true |