Skip to content

Commit

Permalink
GH actions: New try with macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenke committed Dec 22, 2024
1 parent c68d519 commit f93822f
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,30 @@ jobs:
fail-fast: false

matrix:
os: [ ubuntu-24.04, windows-latest ]
os: [ macos-latest, ubuntu-latest, windows-latest ]
toolchain: [ GNU, LLVM, MSVC ]
build_type: [ Debug, Release ]
c_compiler: [cl, clang, gcc]
include:
- os: ubuntu-24.04
- os: macos-latest
toolchain: LLVM
- os: ubuntu-latest
toolchain: GNU
c_compiler: gcc-14
cpp_compiler: g++-14
c_compiler: gcc
cpp_compiler: g++
- os: windows-latest
toolchain: LLVM
msvc_toolchain: ClangCL
- os: windows-latest
toolchain: MSVC
msvc_toolchain: v143
exclude:
- os: ubuntu-24.04
- os: macos-latest
toolchain: GNU
- os: macos-latest
toolchain: MSVC
- os: ubuntu-latest
toolchain: LLVM
- os: ubuntu-24.04
- os: ubuntu-latest
toolchain: MSVC
- os: windows-latest
toolchain: GNU
Expand All @@ -48,7 +53,7 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
Expand All @@ -57,19 +62,35 @@ jobs:
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install ninja on macOS
if: runner.os == 'macOS'
run: brew install ninja

- name: Install pkg-config on Windows
if: runner.os == 'Windows'
run: choco install pkgconfiglite

- name: Configure CMake (macOS)
if: runner.os == 'macOS'
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-G 'Ninja'
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_MAKE_PROGRAM=ninja
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-S ${{ github.workspace }}
- name: Configure CMake (Linux)
if: runner.os == 'Linux'
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-S ${{ github.workspace }}
Expand Down

0 comments on commit f93822f

Please sign in to comment.