-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (39 loc) · 1.32 KB
/
build_and_test.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
43
44
45
46
47
48
49
name: Build and Test
on: [push]
env:
CMAKE_BUILD_TYPE: Debug
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Get required GCC version
if: matrix.os == 'ubuntu-latest'
shell: bash
run: sudo apt install gcc-9 g++-9
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake Using Default Compiler
if: matrix.os != 'ubuntu-latest'
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DENABLE_SANITIZERS:BOOL=YES
- name: Configure CMake Using GCC
if: matrix.os == 'ubuntu-latest'
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DENABLE_SANITIZERS:BOOL=YES
env:
CC: gcc-9
CXX: g++-9
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $CMAKE_BUILD_TYPE --target tests
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest -C $CMAKE_BUILD_TYPE --output-on-failure