CI: Only save ccache on master, cap the AppImage one

The Actions cache was full (10 GB), mostly with caches saved by PR runs that only
that PR could restore, and the AppImage ccache had no size limit. Master's got
evicted, so even master builds found no cache and hit 0.3% of the time. PRs
still restore master's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-13 10:10:11 +02:00
1 parent 6cc7d848a1
commit 3ad5657ff4
2 files changed
+17 -1

No files matched your search

+11 -1
View File
@@ -42,6 +42,8 @@ jobs:
container: ghcr.io/pkgforge-dev/archlinux:latest
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
# Unlimited, a cache once reached 1.2 GB.
CCACHE_MAXSIZE: 500M
CCACHE_COMPILERCHECK: content
CCACHE_SLOPPINESS: time_macros
steps:
@@ -68,8 +70,9 @@ jobs:
git remote add upstream https://github.com/hrydgard/ppsspp.git # fetching from official repo as a fallback
git fetch --deepen=15000 --no-recurse-submodules --tags --force upstream || exit 0
# Only master saves the cache (see build.yml), so restoring and saving are separate.
- name: Set up ccache for ${{ matrix.id }}
uses: actions/cache@v6.1.0
uses: actions/cache/restore@v6.1.0
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.id }}-${{ github.sha }}
@@ -170,6 +173,13 @@ jobs:
popd
ccache -s -v
- name: Save ccache for ${{ matrix.id }}
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@v6.1.0
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.id }}-${{ github.sha }}
- name: Create AppImage
shell: bash
run: |
+6
View File
@@ -395,6 +395,9 @@ jobs:
if: matrix.id != 'macos'
with:
key: ${{ matrix.id }}
# Only master saves. The Actions cache holds 10 GB, and PR runs filled it with caches
# only that PR could use, evicting master's, which every run restores from.
save: ${{ github.ref == 'refs/heads/master' }}
- name: Execute build
env:
@@ -578,6 +581,9 @@ jobs:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@f09c25b45002a07be2955cbe52e8cee55643f89d # v1.2.24
with:
# See the other ccache setup.
save: ${{ github.ref == 'refs/heads/master' }}
- name: Compile ffmpeg
run: |