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