blob: 96fd9a120c948a414b81adda940ebbf65a659e1d [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 Nason4e382082022-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"
Daan De Meyerf9726022019-10-10 22:16:49 +0200202
Stefanff693f72022-01-10 15:08:50 +0100203 - os: macOS-10.15
Clare Macrae8df12f22020-02-19 14:27:14 +0000204 compiler: xcode
Stefanff693f72022-01-10 15:08:50 +0100205 version: "10.3"
206
207 - os: macOS-latest
208 compiler: xcode
209 version: "11.7"
210
211 - os: macOS-latest
212 compiler: xcode
213 version: "12.5.1"
214
215 - os: macOS-latest
216 compiler: xcode
217 version: "13.2.1"
218
219 - os: macOS-latest
220 compiler: gcc
221 version: "11"
Daan De Meyerf9726022019-10-10 22:16:49 +0200222
223 steps:
Stefanff693f72022-01-10 15:08:50 +0100224 - uses: actions/checkout@v2
Daan De Meyerf9726022019-10-10 22:16:49 +0200225
226 - name: Install (Linux)
227 if: runner.os == 'Linux'
228 run: |
Daan De Meyer2e3d2652019-10-12 16:10:46 +0200229 # Required for libc6-dbg:i386 and g++-multilib packages which are
Daan De Meyerf9726022019-10-10 22:16:49 +0200230 # needed for x86 builds.
231 sudo dpkg --add-architecture i386
232
233 # clang-3.7 and earlier are not available in Bionic anymore so we get
234 # them from the Xenial repositories instead.
235 sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main"
236 sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe"
Daan De Meyer2e3d2652019-10-12 16:10:46 +0200237
Stefanff693f72022-01-10 15:08:50 +0100238 # clang->=13 is not currently available by default
239 if [ "${{ matrix.compiler }}" = "clang" -a ${{ matrix.version }} -ge 13 ]; then
240 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
241 sudo add-apt-repository "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.version }} main"
Daan De Meyerf9726022019-10-10 22:16:49 +0200242 fi
243
244 sudo apt-get update
245
246 # libc6-dbg:i386 is required for running valgrind on x86.
247 sudo apt-get install -y ninja-build valgrind libc6-dbg:i386
248
249 if [ "${{ matrix.compiler }}" = "gcc" ]; then
250 sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
Daan De Meyerf9726022019-10-10 22:16:49 +0200251 else
252 sudo apt-get install -y clang-${{ matrix.version }} g++-multilib
Daan De Meyerf9726022019-10-10 22:16:49 +0200253 fi
254
255 - name: Install (macOS)
256 if: runner.os == 'macOS'
257 run: |
Stefanff693f72022-01-10 15:08:50 +0100258 brew install ninja
259 if [ "${{ matrix.compiler }}" = "xcode" ]; then
260 sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
261 fi
Daan De Meyerf9726022019-10-10 22:16:49 +0200262
263 - name: Configure x64
Stefanff693f72022-01-10 15:08:50 +0100264 uses: ilammy/msvc-dev-cmd@v1
Daan De Meyerf9726022019-10-10 22:16:49 +0200265
Stefanff693f72022-01-10 15:08:50 +0100266 - name: Build & Test x64
267 run: python3 .github/workflows/build_and_test.py ${{ runner.os }} x64 ${{ matrix.compiler }} ${{ matrix.version }}
Daan De Meyerf9726022019-10-10 22:16:49 +0200268
269 - name: Configure x86
Stefanff693f72022-01-10 15:08:50 +0100270 uses: ilammy/msvc-dev-cmd@v1
271 with:
272 arch: x86
Daan De Meyerf9726022019-10-10 22:16:49 +0200273
Stefanff693f72022-01-10 15:08:50 +0100274 # MacOS doesn't support x86 from Xcode 10 onwards.
Daan De Meyerf9726022019-10-10 22:16:49 +0200275
Stefanff693f72022-01-10 15:08:50 +0100276 - name: Build & Test x86
277 if: runner.os == 'Linux' || runner.os == 'Windows' && matrix.compiler != 'clang-cl'
278 run: python3 .github/workflows/build_and_test.py ${{ runner.os }} x86 ${{ matrix.compiler }} ${{ matrix.version }}
Daan De Meyerf9726022019-10-10 22:16:49 +0200279
Stefanff693f72022-01-10 15:08:50 +0100280 ci-min-gw:
Stefan76cc1372022-01-18 00:17:46 +0100281 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Stefanff693f72022-01-10 15:08:50 +0100282 runs-on: windows-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200283
Stefanff693f72022-01-10 15:08:50 +0100284 strategy:
285 fail-fast: false
286 matrix:
287 configuration: ["Debug", "Release"]
Daan De Meyerf9726022019-10-10 22:16:49 +0200288
Stefanff693f72022-01-10 15:08:50 +0100289 steps:
290 - uses: actions/checkout@v2
291
292 - name: Set up MinGW
293 uses: egor-tensin/setup-mingw@v2
294
295 - name: Generate
296 run: cmake -B build -S . -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=${{ matrix.configuration }}
297
298 - name: Build
299 run: cmake --build build
300
301 - name: Test
302 run: ctest --test-dir build --no-tests=error
303
304 ci-msvs:
Stefan76cc1372022-01-18 00:17:46 +0100305 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Stefanf54a4e42022-02-14 18:22:45 +0100306 runs-on: ${{ matrix.toolset == 'v143' && 'windows-2022' || 'windows-2019' }}
Stefanff693f72022-01-10 15:08:50 +0100307
308 strategy:
309 fail-fast: false
310 matrix:
311 toolset: ["v140", "v141", "v142", "v143", "ClangCl"]
312 architecture: ["Win32", "x64"]
313 configuration: ["Debug", "Release"]
314
315 steps:
316 - uses: actions/checkout@v2
Stefandb758e02022-06-06 03:42:02 +0200317
Stefanff693f72022-01-10 15:08:50 +0100318 - name: Generate
319 run: cmake -B build -S . -G "${{ matrix.toolset == 'v143' && 'Visual Studio 17 2022' || 'Visual Studio 16 2019' }}" \
320 -A ${{ matrix.architecture }} -T ${{ matrix.toolset }}
321
322 - name: Build
323 run: cmake --build build --config ${{ matrix.configuration }}
324
325 - name: Test
326 run: ctest -C ${{ matrix.configuration }} --test-dir build --no-tests=error