From c0e45650466c23151dff280d242b748cad4e7fa3 Mon Sep 17 00:00:00 2001 From: James Dansereau <106631954+jkdansereau@users.noreply.github.com> Date: Fri, 4 Sep 2026 22:10:41 -0400 Subject: [PATCH] ci: add ccache to Linux + Windows build jobs (speed-ups plan Step 5) CMakeLists.txt already opt-in enables CMAKE_{C,CXX}_COMPILER_LAUNCHER= ccache when found (b4de1c68); CI just never installed ccache or persisted its cache dir across runs. Wires actions/cache + ccache install into both linux-build and windows-build, keyed on CMakeLists.txt's hash. Game sources are frozen, so this should give a near-total hit rate after the first run on each job. YAML-validated; the actual hit-rate payoff needs a real CI run (cold, then warm) to confirm -- not verifiable locally. Claude-Session: https://claude.ai/code/session_01P3WrUHAFQZUuhrHhiJgTUr --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc3e7910..d663553c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,6 +147,12 @@ jobs: env: CC: gcc-14 CXX: g++-14 + # CMakeLists.txt opt-in enables CMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache + # when ccache is on PATH (b4de1c68, speed-ups plan Step 5). Game + # sources are frozen (1:1 with the decomp), so after the first run only + # touched port/ files miss cache -- near-total hit rate. + CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_MAXSIZE: 500M steps: - uses: actions/checkout@v7 with: @@ -156,7 +162,16 @@ jobs: run: | sudo apt-get update sudo apt-get install -y build-essential gcc-14 g++-14 cmake python3 \ - libsdl2-dev zlib1g-dev libgl1-mesa-dev + libsdl2-dev zlib1g-dev libgl1-mesa-dev ccache + + - name: Restore ccache + uses: actions/cache@v4 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-linux-${{ hashFiles('CMakeLists.txt') }}-${{ github.sha }} + restore-keys: | + ccache-linux-${{ hashFiles('CMakeLists.txt') }}- + ccache-linux- - name: Regenerate ROM-asset symbol file (US) run: python3 scripts/gen_romassets.py u @@ -168,6 +183,9 @@ jobs: - name: Build (ntsc-final) run: cmake --build build-linux -j"$(nproc)" + - name: ccache stats + run: ccache -s + - name: Show binary run: | ls -la build-linux/ge007* || true @@ -210,6 +228,13 @@ jobs: defaults: run: shell: msys2 {0} + env: + # Same opt-in ccache CMakeLists.txt already wires up (Step 5). Note: + # this cache path is read/written by the JS actions/cache step outside + # the msys2 shell too, so it stays a plain workspace-relative path + # rather than an msys /c/... form. + CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_MAXSIZE: 500M steps: - uses: actions/checkout@v7 with: @@ -225,15 +250,28 @@ jobs: mingw-w64-x86_64-SDL2 mingw-w64-x86_64-zlib mingw-w64-x86_64-python + mingw-w64-x86_64-ccache zip unzip + - name: Restore ccache + uses: actions/cache@v4 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-windows-${{ hashFiles('CMakeLists.txt') }}-${{ github.sha }} + restore-keys: | + ccache-windows-${{ hashFiles('CMakeLists.txt') }}- + ccache-windows- + - name: Regenerate ROM-asset symbol file (US) run: python scripts/gen_romassets.py u - name: Build (ntsc-final) run: ./build-pc.sh ntsc-final + - name: ccache stats + run: ccache -s + # Package the distributable bundle on every run so the release path is # always exercised. On a tag build VERSION is the tag; otherwise it is a # throwaway CI string. bundle-win.sh hard-fails if a ROM image or an