Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/cache-refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
# List all ccache-* cache keys, strip the run_id suffix to deduplicate by flavor/arch.
# List main-scoped ccache-* cache keys, strip the run_id suffix to deduplicate
# by flavor/arch. We specifically skip non-main branches, becuse we only want to save/restore
# from main - in GH, PR branches can use `main` caches, but main cannot see PR branch caches,
# and saving duplicated PR branch caches counts against our 10GB github limit
matrix=$(gh api "/repos/${{ github.repository }}/actions/caches" --paginate \
--jq '[.actions_caches[]
| select(.key | startswith("ccache-"))
| select(.ref == "refs/heads/main" and (.key | startswith("ccache-")))
| {prefix: (.key | gsub("-[0-9]+$"; ""))}]
| unique_by(.prefix)
| {entry: .}')
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ jobs:
compression-level: 0
retention-days: 1
- name: save ccache
# Only save from main. GH's per-repo 10GB cache pool is shared across all refs,
# so PR-scoped saves evict main-scoped entries via LRU - and main is the only ref
# whose entries the next build can actually restore. PRs still benefit because
# they will fallthrough to/inherit parent branch caches
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.2
with:
path: ~/.cache/kernel-ccache
Expand Down