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.
This commit is contained in:
willcl-ark
2026-02-11 00:58:35 +00:00
parent 337fef9f2f
commit c413cf12c5

View File

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