Skip to content

Commit 4d0836d

Browse files
committed
CI: windows: Skip rebuilding vcpkg packages when cache restored
1 parent a79600d commit 4d0836d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/windows.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
shell: pwsh
8686

8787
- name: Restore vcpkg artifact
88+
id: restore-vcpkg
8889
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
8990
with:
9091
path: src\vcpkg_installed
@@ -94,13 +95,14 @@ jobs:
9495
run: |
9596
vcpkg install --vcpkg-root=%USERPROFILE%\scoop\apps\vcpkg\current
9697
working-directory: src
98+
if: ${{ ! steps.restore-vcpkg.outputs.cache-hit }}
9799

98100
- name: Save vcpkg artifact
99101
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
100102
with:
101103
path: src\vcpkg_installed
102104
key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }}
103-
if: ${{ github.ref_name == 'master' || startsWith(github.ref_name, 'ruby_') }}
105+
if: ${{ ! steps.restore-vcpkg.outputs.cache-hit && (github.ref_name == 'master' || startsWith(github.ref_name, 'ruby_')) }}
104106

105107
- name: setup env
106108
# Available Ruby versions: https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md#ruby

0 commit comments

Comments
 (0)