Skip to content

Commit 38297e4

Browse files
nobuk0kubun
authored andcommitted
CI: windows: Skip rebuilding vcpkg packages when cache restored
1 parent 958bdaf commit 38297e4

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
@@ -113,6 +113,7 @@ jobs:
113113
shell: pwsh
114114

115115
- name: Restore vcpkg artifact
116+
id: restore-vcpkg
116117
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
117118
with:
118119
path: src\vcpkg_installed
@@ -122,13 +123,14 @@ jobs:
122123
run: |
123124
vcpkg install --vcpkg-root=C:\Users\runneradmin\scoop\apps\vcpkg\current
124125
working-directory: src
126+
if: ${{ ! steps.restore-vcpkg.outputs.cache-hit }}
125127

126128
- name: Save vcpkg artifact
127129
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
128130
with:
129131
path: src\vcpkg_installed
130132
key: windows-${{ matrix.os }}-vcpkg-${{ hashFiles('src/vcpkg.json') }}
131-
if: ${{ github.ref_name == 'master' || startsWith(github.ref_name, 'ruby_') }}
133+
if: ${{ ! steps.restore-vcpkg.outputs.cache-hit && (github.ref_name == 'master' || startsWith(github.ref_name, 'ruby_')) }}
132134

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

0 commit comments

Comments
 (0)