From 3ad5657ff46baa4a847b2e7d299c6aba3db750e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 13 Oct 2026 10:10:11 +0200 Subject: [PATCH] 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 --- .github/workflows/appimage.yml | 12 +++++++++++- .github/workflows/build.yml | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 9496b35925..f9a426e6d2 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -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: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35a7477d2c..602830d69f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: |