-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (50 loc) · 1.59 KB
/
ci.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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
CTEST_PARALLEL_LEVEL: 3
jobs:
cpp-tests:
name: Tests ${{ matrix.config.os }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, toolchain: "" }
- { os: macos-latest, toolchain: "" }
- { os: windows-latest, toolchain: "-T ClangCl" }
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_MISIM_TESTS=ON ${{ matrix.config.toolchain }}
- name: Build
run: cmake --build build --config Release
- name: Test
run: ctest -C Release --output-on-failure --test-dir build --repeat until-pass:3 --timeout 300
- if: runner.os == 'Linux'
name: Coverage
run: |
cmake -S . -B buildCov -DCMAKE_BUILD_TYPE=Debug -DBUILD_MISIM_TESTS=ON -DENABLE_COVERAGE=ON
cmake --build buildCov --config Debug
ctest -C Debug --output-on-failure --test-dir buildCov --repeat until-pass:3 --timeout 300
- if: runner.os == 'Linux'
name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.1
with:
fail_ci_if_error: true
gcov: true
gcov_ignore: "extern/**/*"
token: ${{ secrets.CODECOV_TOKEN }}