blob: 05c578c35cc0a85c1b0c79073571cf6078ad5c4b [file] [log] [blame]
Daan De Meyerf9726022019-10-10 22:16:49 +02001name: CI
2
Stefan2ef137d2022-01-11 20:33:39 +01003on:
4 push:
5 paths-ignore:
6 - 'doc/**'
7 - 'scripts/**'
8 - 'LICENSE.txt'
9 - 'README.md'
Stefanaaa72532022-01-18 00:16:44 +010010 pull_request:
Salvagea2124382022-01-24 21:32:39 +010011 paths-ignore:
12 - 'doc/**'
13 - 'scripts/**'
14 - 'LICENSE.txt'
15 - 'README.md'
Daan De Meyerf9726022019-10-10 22:16:49 +020016
Stefanff693f72022-01-10 15:08:50 +010017env:
18 CTEST_OUTPUT_ON_FAILURE: ON
19 CTEST_PARALLEL_LEVEL: 2
20
Daan De Meyerf9726022019-10-10 22:16:49 +020021jobs:
Stefanbf037c12022-01-20 13:06:51 +010022 coverage:
Stefanbf037c12022-01-20 13:06:51 +010023 runs-on: ubuntu-latest
Stefandb758e02022-06-06 03:42:02 +020024
Stefanbf037c12022-01-20 13:06:51 +010025 steps:
26 - uses: actions/checkout@v2
Stefandb758e02022-06-06 03:42:02 +020027
Stefanbf037c12022-01-20 13:06:51 +010028 - name: Install
29 run: sudo apt-get install -y ninja-build lcov
Stefandb758e02022-06-06 03:42:02 +020030
Stefanbf037c12022-01-20 13:06:51 +010031 - name: Generate
32 run: cmake -B build -S . -G Ninja -D CMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage"
33
34 - name: Build
35 run: cmake --build build
36
37 - name: Test
38 run: ctest --test-dir build --no-tests=error
Stefandb758e02022-06-06 03:42:02 +020039
Stefanbf037c12022-01-20 13:06:51 +010040 - name: LCOV
41 run: |
42 mkdir coverage
43 lcov -c -d build/ -o coverage/lcov.info --include "*doctest/parts*"
Stefandb758e02022-06-06 03:42:02 +020044
Stefanbf037c12022-01-20 13:06:51 +010045 - name: Codecov
46 uses: codecov/codecov-action@v2
47 with:
48 files: ./coverage/lcov.info
49 fail_ci_if_error: true
50
Stefandb758e02022-06-06 03:42:02 +020051 clang-tidy:
52 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
53 runs-on: ubuntu-22.04
54
55 steps:
56 - uses: actions/checkout@v2
57
58 - name: Install
59 run: sudo apt-get install -y ninja-build clang-tidy-14
60
61 - name: Generate
62 run: cmake -B build -S . -G Ninja -D CMAKE_CXX_COMPILER=clang++ -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D CMAKE_CXX_CLANG_TIDY="clang-tidy-14;-warnings-as-errors=*"
63
64 - name: Build
65 run: cmake --build build
66
Benbuck Nason4ba20f92022-10-03 07:45:43 -070067 sanitizers:
68 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
69 runs-on: ubuntu-22.04
70
71 strategy:
72 fail-fast: false
73 matrix:
74 sanitizers: ["address", "thread", "undefined", "integer", "implicit-conversion", "nullability", "safe-stack"]
75
76 steps:
77 - uses: actions/checkout@v2
78
79 - name: Install
80 run: sudo apt-get install -y ninja-build
81
82 - name: Generate
83 run: cmake -B build -S . -G Ninja -D CMAKE_CXX_COMPILER=clang++ -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D CMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitizers }}"
84
85 - name: Build
86 run: cmake --build build
87
88 - name: Test
89 run: ctest --test-dir build --no-tests=error
90
Daan De Meyerf9726022019-10-10 22:16:49 +020091 ci:
Stefan76cc1372022-01-18 00:17:46 +010092 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Daan De Meyerf9726022019-10-10 22:16:49 +020093 runs-on: ${{ matrix.os }}
94
95 env:
96 CMAKE_GENERATOR: Ninja
97 ASAN_OPTIONS: strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true:check_initialization_order=true:strict_init_order=true
98 TSAN_OPTIONS: force_seq_cst_atomics=1
99
100 strategy:
101 fail-fast: false
102 matrix:
Stefanff693f72022-01-10 15:08:50 +0100103 os: ["windows-2019", "windows-2022"]
104 compiler: ["cl", "clang", "clang-cl"]
Daan De Meyerf9726022019-10-10 22:16:49 +0200105
106 include:
Stefanff693f72022-01-10 15:08:50 +0100107 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200108 compiler: gcc
109 version: "4.8"
110
Stefanff693f72022-01-10 15:08:50 +0100111 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200112 compiler: gcc
113 version: "4.9"
114
Stefanff693f72022-01-10 15:08:50 +0100115 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200116 compiler: gcc
117 version: "5"
118
Stefanff693f72022-01-10 15:08:50 +0100119 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200120 compiler: gcc
121 version: "6"
122
Stefanff693f72022-01-10 15:08:50 +0100123 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200124 compiler: gcc
125 version: "7"
126
Stefanff693f72022-01-10 15:08:50 +0100127 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200128 compiler: gcc
129 version: "8"
130
Stefanff693f72022-01-10 15:08:50 +0100131 - os: ubuntu-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200132 compiler: gcc
133 version: "9"
134
Stefanff693f72022-01-10 15:08:50 +0100135 - os: ubuntu-latest
Viktor Kirilov0915b9d2020-12-16 11:57:51 +0200136 compiler: gcc
137 version: "10"
138
Stefanff693f72022-01-10 15:08:50 +0100139 - os: ubuntu-latest
140 compiler: gcc
141 version: "11"
142
143 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200144 compiler: clang
145 version: "3.5"
146
Stefanff693f72022-01-10 15:08:50 +0100147 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200148 compiler: clang
149 version: "3.6"
150
Stefanff693f72022-01-10 15:08:50 +0100151 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200152 compiler: clang
153 version: "3.7"
154
Stefanff693f72022-01-10 15:08:50 +0100155 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200156 compiler: clang
157 version: "3.8"
158
Stefanff693f72022-01-10 15:08:50 +0100159 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200160 compiler: clang
161 version: "3.9"
162
Stefanff693f72022-01-10 15:08:50 +0100163 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200164 compiler: clang
165 version: "4.0"
166
Stefanff693f72022-01-10 15:08:50 +0100167 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200168 compiler: clang
169 version: "5.0"
170
Stefanff693f72022-01-10 15:08:50 +0100171 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200172 compiler: clang
173 version: "6.0"
174
Stefanff693f72022-01-10 15:08:50 +0100175 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200176 compiler: clang
177 version: "7"
178
Stefanff693f72022-01-10 15:08:50 +0100179 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200180 compiler: clang
181 version: "8"
182
Stefanff693f72022-01-10 15:08:50 +0100183 - os: ubuntu-latest
184 compiler: clang
185 version: "9"
Daan De Meyerf9726022019-10-10 22:16:49 +0200186
Stefanff693f72022-01-10 15:08:50 +0100187 - os: ubuntu-latest
Viktor Kirilov0915b9d2020-12-16 11:57:51 +0200188 compiler: clang
189 version: "10"
190
Stefanff693f72022-01-10 15:08:50 +0100191 - os: ubuntu-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200192 compiler: clang
Stefanff693f72022-01-10 15:08:50 +0100193 version: "11"
Daan De Meyerf9726022019-10-10 22:16:49 +0200194
Stefanff693f72022-01-10 15:08:50 +0100195 - os: ubuntu-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200196 compiler: clang
Stefanff693f72022-01-10 15:08:50 +0100197 version: "12"
Daan De Meyerf9726022019-10-10 22:16:49 +0200198
Stefanff693f72022-01-10 15:08:50 +0100199 - os: ubuntu-latest
200 compiler: clang
201 version: "13"
Stefan9d042702022-10-08 00:55:25 +0200202
203 - os: ubuntu-latest
204 compiler: clang
205 version: "14"
206
207 - os: ubuntu-latest
208 compiler: clang
209 version: "15"
210
Stefanff693f72022-01-10 15:08:50 +0100211 - os: macOS-10.15
Clare Macrae8df12f22020-02-19 14:27:14 +0000212 compiler: xcode
Stefanff693f72022-01-10 15:08:50 +0100213 version: "10.3"
214
215 - os: macOS-latest
216 compiler: xcode
217 version: "11.7"
218
219 - os: macOS-latest
220 compiler: xcode
221 version: "12.5.1"
222
223 - os: macOS-latest
224 compiler: xcode
225 version: "13.2.1"
Stefan9d042702022-10-08 00:55:25 +0200226
227 - os: macos-12
228 compiler: xcode
229 version: "14.0.1"
Stefanff693f72022-01-10 15:08:50 +0100230
231 - os: macOS-latest
232 compiler: gcc
233 version: "11"
Daan De Meyerf9726022019-10-10 22:16:49 +0200234
235 steps:
Stefanff693f72022-01-10 15:08:50 +0100236 - uses: actions/checkout@v2
Daan De Meyerf9726022019-10-10 22:16:49 +0200237
238 - name: Install (Linux)
239 if: runner.os == 'Linux'
240 run: |
Daan De Meyer2e3d2652019-10-12 16:10:46 +0200241 # Required for libc6-dbg:i386 and g++-multilib packages which are
Daan De Meyerf9726022019-10-10 22:16:49 +0200242 # needed for x86 builds.
243 sudo dpkg --add-architecture i386
244
245 # clang-3.7 and earlier are not available in Bionic anymore so we get
246 # them from the Xenial repositories instead.
247 sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main"
248 sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe"
Daan De Meyer2e3d2652019-10-12 16:10:46 +0200249
Stefanff693f72022-01-10 15:08:50 +0100250 # clang->=13 is not currently available by default
251 if [ "${{ matrix.compiler }}" = "clang" -a ${{ matrix.version }} -ge 13 ]; then
252 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
253 sudo add-apt-repository "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.version }} main"
Daan De Meyerf9726022019-10-10 22:16:49 +0200254 fi
255
256 sudo apt-get update
257
258 # libc6-dbg:i386 is required for running valgrind on x86.
259 sudo apt-get install -y ninja-build valgrind libc6-dbg:i386
260
261 if [ "${{ matrix.compiler }}" = "gcc" ]; then
262 sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
Daan De Meyerf9726022019-10-10 22:16:49 +0200263 else
264 sudo apt-get install -y clang-${{ matrix.version }} g++-multilib
Daan De Meyerf9726022019-10-10 22:16:49 +0200265 fi
266
267 - name: Install (macOS)
268 if: runner.os == 'macOS'
269 run: |
Stefanff693f72022-01-10 15:08:50 +0100270 brew install ninja
271 if [ "${{ matrix.compiler }}" = "xcode" ]; then
272 sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
273 fi
Daan De Meyerf9726022019-10-10 22:16:49 +0200274
275 - name: Configure x64
Stefanff693f72022-01-10 15:08:50 +0100276 uses: ilammy/msvc-dev-cmd@v1
Daan De Meyerf9726022019-10-10 22:16:49 +0200277
Stefanff693f72022-01-10 15:08:50 +0100278 - name: Build & Test x64
279 run: python3 .github/workflows/build_and_test.py ${{ runner.os }} x64 ${{ matrix.compiler }} ${{ matrix.version }}
Daan De Meyerf9726022019-10-10 22:16:49 +0200280
281 - name: Configure x86
Stefanff693f72022-01-10 15:08:50 +0100282 uses: ilammy/msvc-dev-cmd@v1
283 with:
284 arch: x86
Daan De Meyerf9726022019-10-10 22:16:49 +0200285
Stefanff693f72022-01-10 15:08:50 +0100286 # MacOS doesn't support x86 from Xcode 10 onwards.
Daan De Meyerf9726022019-10-10 22:16:49 +0200287
Stefanff693f72022-01-10 15:08:50 +0100288 - name: Build & Test x86
289 if: runner.os == 'Linux' || runner.os == 'Windows' && matrix.compiler != 'clang-cl'
290 run: python3 .github/workflows/build_and_test.py ${{ runner.os }} x86 ${{ matrix.compiler }} ${{ matrix.version }}
Daan De Meyerf9726022019-10-10 22:16:49 +0200291
Stefanff693f72022-01-10 15:08:50 +0100292 ci-min-gw:
Stefan76cc1372022-01-18 00:17:46 +0100293 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Stefanff693f72022-01-10 15:08:50 +0100294 runs-on: windows-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200295
Stefanff693f72022-01-10 15:08:50 +0100296 strategy:
297 fail-fast: false
298 matrix:
299 configuration: ["Debug", "Release"]
Daan De Meyerf9726022019-10-10 22:16:49 +0200300
Stefanff693f72022-01-10 15:08:50 +0100301 steps:
302 - uses: actions/checkout@v2
303
304 - name: Set up MinGW
305 uses: egor-tensin/setup-mingw@v2
306
307 - name: Generate
308 run: cmake -B build -S . -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=${{ matrix.configuration }}
309
310 - name: Build
311 run: cmake --build build
312
313 - name: Test
314 run: ctest --test-dir build --no-tests=error
315
316 ci-msvs:
Stefan76cc1372022-01-18 00:17:46 +0100317 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Stefanf54a4e42022-02-14 18:22:45 +0100318 runs-on: ${{ matrix.toolset == 'v143' && 'windows-2022' || 'windows-2019' }}
Stefanff693f72022-01-10 15:08:50 +0100319
320 strategy:
321 fail-fast: false
322 matrix:
323 toolset: ["v140", "v141", "v142", "v143", "ClangCl"]
324 architecture: ["Win32", "x64"]
325 configuration: ["Debug", "Release"]
326
327 steps:
328 - uses: actions/checkout@v2
Stefandb758e02022-06-06 03:42:02 +0200329
Stefanff693f72022-01-10 15:08:50 +0100330 - name: Generate
331 run: cmake -B build -S . -G "${{ matrix.toolset == 'v143' && 'Visual Studio 17 2022' || 'Visual Studio 16 2019' }}" \
332 -A ${{ matrix.architecture }} -T ${{ matrix.toolset }}
333
334 - name: Build
335 run: cmake --build build --config ${{ matrix.configuration }}
336
337 - name: Test
338 run: ctest -C ${{ matrix.configuration }} --test-dir build --no-tests=error