-
Notifications
You must be signed in to change notification settings - Fork 92
33 lines (26 loc) · 995 Bytes
/
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
name: build-and-test
on:
push:
branches: [master]
jobs:
build-and-test:
name: Build and test on ${{matrix.os}} in ${{matrix.build-type}} mode
runs-on: ${{matrix.os}}
strategy:
matrix:
build-type: [Debug, Release]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/build
shell: bash # Necessary because of the $GITHUB_WORKSPACE variable
run: cmake -DCMAKE_BUILD_TYPE=${{matrix.build-type}} -DBUILD_TESTING=ON -S $GITHUB_WORKSPACE
- name: Build
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config ${{matrix.build-type}}
- name: Test
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build-type}} --verbose --rerun-failed --output-on-failure