-
Notifications
You must be signed in to change notification settings - Fork 166
43 lines (32 loc) · 1.25 KB
/
cmake.yml
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
name: BuildAndTest
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-test:
strategy:
matrix:
platform: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
build-type: [ "Release", "Debug" ]
include:
- platform: "ubuntu-latest"
cmake-flags: "-G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
dependencies: "sudo apt install ninja-build"
fail-fast: false
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v3
- name: Install build dependencies
run: ${{ matrix.dependencies }}
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{matrix.cmake-flags}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build-type}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{matrix.build-type}} --output-on-failure --timeout 400 --interactive-debug-mode 0