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: |