Skip to content

Commit

Permalink
CI: Clone vcpkg on macOS & set VCPKG_ROOT conditionally
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
patrikhuber committed Dec 10, 2024
1 parent 3e4b507 commit 9ae354d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2019, ubuntu-latest, ubuntu-20.04, macos-latest, macos-11]
os: [windows-latest, windows-2019, ubuntu-24.04, ubuntu-latest, ubuntu-20.04, macos-latest, macos-13]

name: ${{matrix.os}}

Expand All @@ -33,10 +33,20 @@ jobs:
with:
submodules: true

- name: "Set VCPKG_ROOT environment variable"
- name: Install vcpkg on macOS if not pre-installed
if: runner.os == 'macOS' && (matrix.os == 'macos-13' || matrix.os == 'macos-latest')
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
shell: bash

- name: Set VCPKG_ROOT environment variable
shell: bash
run: |
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
if [[ "$RUNNER_OS" == "macOS" ]]; then
echo "VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg" >> $GITHUB_ENV
else
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
- name: Cache/restore vcpkg dependencies
uses: actions/cache@v3
Expand Down

0 comments on commit 9ae354d

Please sign in to comment.