Skip to content

Commit 9ae354d

Browse files
committed
CI: Clone vcpkg on macOS & set VCPKG_ROOT conditionally
Removed macos-11 (I think those runners don't exist anymore) and added macos-13 instead (macos-latest is currently 14). According to various GitHub issues (using a ChatGPT web search), only macOS12 and 13 (Intel) still contain vcpkg pre-installed - the ARM64 versions and macOS 14 (Intel) do not contain vcpkg preinstalled anymore. So we manually clone it on macOS. Note: We should probably migrate to using https://github.com/marketplace/actions/run-vcpkg. Also added ubuntu-24.04 to see if that builds.
1 parent 3e4b507 commit 9ae354d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/cmake.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
os: [windows-latest, windows-2019, ubuntu-latest, ubuntu-20.04, macos-latest, macos-11]
21+
os: [windows-latest, windows-2019, ubuntu-24.04, ubuntu-latest, ubuntu-20.04, macos-latest, macos-13]
2222

2323
name: ${{matrix.os}}
2424

@@ -33,10 +33,20 @@ jobs:
3333
with:
3434
submodules: true
3535

36-
- name: "Set VCPKG_ROOT environment variable"
36+
- name: Install vcpkg on macOS if not pre-installed
37+
if: runner.os == 'macOS' && (matrix.os == 'macos-13' || matrix.os == 'macos-latest')
38+
run: |
39+
git clone https://github.com/microsoft/vcpkg.git
40+
./vcpkg/bootstrap-vcpkg.sh
41+
shell: bash
42+
43+
- name: Set VCPKG_ROOT environment variable
3744
shell: bash
3845
run: |
39-
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
46+
if [[ "$RUNNER_OS" == "macOS" ]]; then
47+
echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV
48+
else
49+
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
4050
4151
- name: Cache/restore vcpkg dependencies
4252
uses: actions/cache@v3

0 commit comments

Comments
 (0)