forked from kaidokert/minijson_reader
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.86 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
name: CMake based CI
on:
push:
branches: [develop]
pull_request:
branches: [develop, master]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos, ubuntu, windows]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- name: Install python dependencies
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
shell: bash
run: |
pip3 install -r ${{github.workspace}}/.requirement.txt
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt-get install gcc-10 # libgtest-dev
CXX=g++-10 cmake -B ${{github.workspace}}/build -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
shell: bash
run: |
# brew install googletest
cmake -B ${{github.workspace}}/build -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja
- name: Configure CMake on windows
if: startsWith(matrix.os, 'windows')
# Configure CMake in a 'build' subdirectory. See too
run: cmake -B ${{github.workspace}}/build -D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
shell: bash
run: |
ctest -C ${{env.BUILD_TYPE}}
- name: Gcovr
shell: bash
run: |
gcovr --root . || echo Ignored