-
Notifications
You must be signed in to change notification settings - Fork 16
107 lines (100 loc) · 3.09 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: C++
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CMAKE_BUILD_PARALLEL_LEVEL: 3
CTEST_PARALLEL_LEVEL: 3
defaults:
run:
shell: bash
jobs:
cpp-tests-ubuntu:
name: 🐧 Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install flint
run: sudo apt-get install libflint-dev
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
prepend_symlinks_to_path: false
override_cache_key: c++-tests-ubuntu-latest
- name: Set up mold as linker
uses: rui314/setup-mold@v1
- name: Install Ninja
run: pipx install ninja
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- 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 600
cpp-tests-macos:
name: 🍎 Release
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install flint
run: brew install flint
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
prepend_symlinks_to_path: false
override_cache_key: c++-tests-macos-latest
- name: Install Ninja
run: pipx install ninja
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- 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 600
coverage:
name: 📈 Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install flint
run: sudo apt-get install libflint-dev
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
prepend_symlinks_to_path: false
override_cache_key: c++-coverage
- name: Set up mold as linker
uses: rui314/setup-mold@v1
- name: Install Ninja
run: pipx install ninja
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON
- name: Build
run: cmake --build build --config Debug
- name: Test
run: ctest -C Debug --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600
- name: Upload coverage to Codecov
# Coverage uploads can be flaky, so we retry them a few times.
uses: Wandalen/[email protected]
with:
action: codecov/codecov-action@v3
attempt_limit: 5
attempt_delay: 2000
with: |
fail_ci_if_error: true
flags: cpp
gcov: true
gcov_ignore: "extern/**/*"
token: ${{ secrets.token }}