From b1caec892e6e07a3e986cb7f6fb546a07664fe88 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 29 Apr 2026 04:16:17 +0000 Subject: [PATCH 1/2] fix: use rolling cache key for clcache on Windows to get cache hits The static key caused clcache to restore a stale entry after every MSVC runner update, resulting in 0 hits / 701 misses on every build run. A sha-based key with a prefix restore-keys fallback and save-always mirrors the rolling strategy used by ccache-action on Linux/macOS. https://claude.ai/code/session_01XTvMZtPH8WpuiRBZkqWiHk --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2bd8c2a..2527942c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,7 +76,10 @@ jobs: uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ${{ github.workspace }}\.clcache - key: ${{ github.job }}-${{ matrix.platform }} + key: ${{ github.job }}-${{ matrix.platform }}-${{ github.sha }} + restore-keys: | + ${{ github.job }}-${{ matrix.platform }}- + save-always: true - name: Create sbom, binary & package env: From 9192d1e081a90f260253acf6b28be81727d58d32 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 29 Apr 2026 04:26:37 +0000 Subject: [PATCH 2/2] fix: split clcache into restore/save steps, drop deprecated save-always actions/cache v5.0.5 marks save-always as deprecated and "not working as intended". Replace the single cache step with a restore step before the build and a save step after, guarded by always() so it runs on build failure too. The save is skipped on an exact cache-hit to avoid redundant uploads. https://claude.ai/code/session_01XTvMZtPH8WpuiRBZkqWiHk --- .github/workflows/build.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2527942c..c5474ac9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,15 +71,15 @@ jobs: verbose: 1 create-symlink: true - - name: Setup cache for clcache + - name: Restore cache for clcache + id: clcache-restore if: ${{ matrix.platform == 'windows-latest' }} - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ${{ github.workspace }}\.clcache key: ${{ github.job }}-${{ matrix.platform }}-${{ github.sha }} restore-keys: | ${{ github.job }}-${{ matrix.platform }}- - save-always: true - name: Create sbom, binary & package env: @@ -94,6 +94,13 @@ jobs: python script/build.py python script/package.py + - name: Save cache for clcache + if: ${{ always() && matrix.platform == 'windows-latest' && steps.clcache-restore.outputs.cache-hit != 'true' }} + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: ${{ github.workspace }}\.clcache + key: ${{ steps.clcache-restore.outputs.cache-primary-key }} + - name: Store the distribution packages uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: