diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 8a3477c9eb6..e1dfe0e842b 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -69,6 +69,22 @@ jobs: with: vcpkgGitCommitId: 'ffc071e0c08432c60c9b64f00334c0227667931b' + - name: Restore vcpkg binary cache + id: vcpkg_cache + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/vcpkg-bincache + key: vcpkg-bincache-${{ runner.os }}-arm64-${{ hashFiles('vcpkg.json', 'vcpkg-lock.json') }} + restore-keys: | + vcpkg-bincache-${{ runner.os }}-arm64- + + - name: Configure vcpkg cache directory + run: | + cacheDir="${{ github.workspace }}/vcpkg-bincache" + mkdir -p "$cacheDir" + echo "VCPKG_DEFAULT_BINARY_CACHE=$cacheDir" >> "$GITHUB_ENV" + echo "VCPKG_BINARY_SOURCES=clear;files,$cacheDir,readwrite" >> "$GITHUB_ENV" + - name: Install Dependencies run: | export HOMEBREW_NO_REQUIRE_TAP_TRUST=1 @@ -349,6 +365,13 @@ jobs: CONFIG_STATUS=${PIPESTATUS[0]} if [ $CONFIG_STATUS -eq 0 ]; then echo "✅ CMake configuration complete"; else echo "❌ CMake configuration failed"; exit 1; fi + - name: Save vcpkg binary cache + if: ${{ steps.vcpkg_cache.outputs.cache-hit != 'true' && matrix.game.id == 'generalsxzh' }} + uses: actions/cache/save@v4 + with: + path: ${{ github.workspace }}/vcpkg-bincache + key: ${{ steps.vcpkg_cache.outputs.cache-primary-key || format('vcpkg-bincache-{0}-arm64-{1}', runner.os, hashFiles('vcpkg.json', 'vcpkg-lock.json')) }} + - name: Build ${{ matrix.game.value }} run: | mkdir -p logs diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 1d532a9b3aa..cd42690ac70 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -57,6 +57,25 @@ jobs: with: arch: x86 + - name: Restore vcpkg binary cache + id: vcpkg_cache + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/vcpkg-bincache + key: vcpkg-bincache-${{ runner.os }}-x86-${{ hashFiles('vcpkg.json', 'vcpkg-lock.json') }} + restore-keys: | + vcpkg-bincache-${{ runner.os }}-x86- + + - name: Configure vcpkg cache directory + shell: pwsh + run: | + $cacheDir = "${{ github.workspace }}/vcpkg-bincache" + New-Item -ItemType Directory -Force -Path $cacheDir | Out-Null + "VCPKG_DEFAULT_BINARY_CACHE=$cacheDir" >> $env:GITHUB_ENV + "VCPKG_BINARY_SOURCES=clear;files,$cacheDir,readwrite" >> $env:GITHUB_ENV + "VCPKG_OVERLAY_TRIPLETS=${{ github.workspace }}/triplets" >> $env:GITHUB_ENV + "VCPKG_INSTALL_OPTIONS=--x-abi-tools-use-exact-versions" >> $env:GITHUB_ENV + - name: Configure shell: pwsh run: | @@ -71,6 +90,13 @@ jobs: -DSAGE_USE_DX8=ON ` -DSAGE_USE_DETERMINISTIC_MATH=ON + - name: Save vcpkg binary cache + if: ${{ steps.vcpkg_cache.outputs.cache-hit != 'true' && matrix.game.id == 'generalsxzh' }} + uses: actions/cache/save@v4 + with: + path: ${{ github.workspace }}/vcpkg-bincache + key: ${{ steps.vcpkg_cache.outputs.cache-primary-key || format('vcpkg-bincache-{0}-x86-{1}', runner.os, hashFiles('vcpkg.json', 'vcpkg-lock.json')) }} + - name: Build shell: pwsh run: cmake --build --preset win32-vcpkg --target ${{ matrix.game.target }} diff --git a/docs/WORKLOG/2026-09-DIARY.md b/docs/WORKLOG/2026-09-DIARY.md index a11e137f9d4..bf41af07ee2 100644 --- a/docs/WORKLOG/2026-09-DIARY.md +++ b/docs/WORKLOG/2026-09-DIARY.md @@ -27,6 +27,11 @@ - `.github/prompts/review-pull-request.prompt.md`: Focused on architectural coherence, merge safety, platform isolation, determinism, improvement opportunities, edge cases, and 1-commit policy enforcement, with an interactive inquiry allowing the user to trigger CodeRabbit triage. - `.github/prompts/resolve-coderabbit-findings.prompt.md`: Dedicated prompt to triage, address, or technically rebut all CodeRabbit review findings via GitHub API without conversational filler, preserving dual-engine parity and deterministic math. +### Cross-Platform CI Build Caching +- Introduced vcpkg binary caching (`actions/cache/restore` and `actions/cache/save`) on Windows MSVC (`x86-windows`) in `.github/workflows/build-windows.yml` to prevent rebuilding dependencies from source and dramatically reduce CI duration. +- Added parity vcpkg binary caching for macOS (`arm64-osx`) in `.github/workflows/build-macos.yml`. +- Configured dedicated cache key hashing on both `vcpkg.json` and `vcpkg-lock.json` alongside fallback prefix restore keys. + ## 06/09/2026 ### Abort Premature SCUD Storm Launches - Fixed issue #284 by making the existing missile-launcher null guard active in normal builds and safely checking the special-power lookup.