-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.4 KB
/
Copy pathcmake-multi-platform.yml
File metadata and controls
61 lines (50 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: cmake-multi-platform
on:
workflow_dispatch:
jobs:
build-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
triplet: x64-windows
- os: ubuntu-latest
triplet: x64-linux
- os: macos-latest
triplet: x64-osx
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2
- name: Setup MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Bootstrap vcpkg (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: .\vcpkg\bootstrap-vcpkg.bat
- name: Bootstrap vcpkg (Unix)
if: runner.os != 'Windows'
shell: bash
run: ./vcpkg/bootstrap-vcpkg.sh
- name: Configure
shell: bash
run: >
cmake -S . -B build-matrix
-G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=$PWD/vcpkg/scripts/buildsystems/vcpkg.cmake
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
- name: Build
shell: bash
run: cmake --build build-matrix --parallel
- name: Test
shell: bash
run: ctest --test-dir build-matrix --output-on-failure