From c413cf12c5c6e688e71be84397a6e4fc75b5eaa4 Mon Sep 17 00:00:00 2001 From: willcl-ark Date: Wed, 11 Feb 2026 00:58:35 +0000 Subject: [PATCH] ci: Split vcpkg tools cache into restore/save The vcpkg tools cache was using the combined actions/cache action, which saves on every run regardless of branch. Split it into the restore/save pattern used by the other caches, so that saves only happen on default branch pushes. --- .github/workflows/ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e59c64b9508..14442f207c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -259,11 +259,13 @@ jobs: run: | echo "VCPKG_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "$GITHUB_ENV" - - name: vcpkg tools cache - uses: actions/cache@v5 + - name: Restore vcpkg tools cache + id: vcpkg-tools-cache + uses: actions/cache/restore@v5 with: path: C:/vcpkg/downloads/tools - key: ${{ github.job }}-vcpkg-tools + key: ${{ github.job }}-vcpkg-tools-${{ github.run_id }} + restore-keys: ${{ github.job }}-vcpkg-tools- - name: Restore vcpkg binary cache uses: actions/cache/restore@v4 @@ -283,6 +285,13 @@ jobs: path: ~/AppData/Local/vcpkg/archives key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }} + - name: Save vcpkg tools cache + uses: actions/cache/save@v5 + if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.vcpkg-tools-cache.outputs.cache-hit != 'true' + with: + path: C:/vcpkg/downloads/tools + key: ${{ github.job }}-vcpkg-tools-${{ github.run_id }} + - name: Build run: | py -3 .github/ci-windows.py ${{ matrix.job-type }} build