Skip to content

Commit 362f8fa

Browse files
committed
CI: checkout + bootstrap vcpkg at the baseline on Windows so the version DB matches
1 parent a3ab1ec commit 362f8fa

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ jobs:
3434

3535
- name: Configure (Windows, vcpkg)
3636
if: runner.os == 'Windows'
37-
shell: bash
3837
run: |
39-
# The runner's pre-installed vcpkg may not contain the manifest's
40-
# builtin-baseline commit, so fetch it before configuring.
41-
BASE=$(jq -r '."builtin-baseline"' vcpkg.json)
42-
git -C "$VCPKG_INSTALLATION_ROOT" fetch --depth 1 origin "$BASE"
43-
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
38+
# Sync the runner's vcpkg to the manifest's builtin-baseline so its
39+
# port/version database matches, then configure.
40+
$base = (Get-Content vcpkg.json | ConvertFrom-Json).'builtin-baseline'
41+
git -C "$env:VCPKG_INSTALLATION_ROOT" fetch --depth 1 origin $base
42+
git -C "$env:VCPKG_INSTALLATION_ROOT" checkout -f $base
43+
& "$env:VCPKG_INSTALLATION_ROOT\bootstrap-vcpkg.bat" -disableMetrics
44+
cmake -B build -S . "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
4445
4546
# --- build + verify install/export ---
4647
- name: Build

0 commit comments

Comments
 (0)