blob: 8381c5534b57e7ff540358296820f972f2510758 [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:
Daan De Meyerf9726022019-10-10 22:16:49 +020011
Stefanff693f72022-01-10 15:08:50 +010012env:
13 CTEST_OUTPUT_ON_FAILURE: ON
14 CTEST_PARALLEL_LEVEL: 2
15
Daan De Meyerf9726022019-10-10 22:16:49 +020016jobs:
17 ci:
Stefan76cc1372022-01-18 00:17:46 +010018 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Daan De Meyerf9726022019-10-10 22:16:49 +020019 runs-on: ${{ matrix.os }}
20
21 env:
22 CMAKE_GENERATOR: Ninja
23 ASAN_OPTIONS: strict_string_checks=true:detect_odr_violation=2:detect_stack_use_after_return=true:check_initialization_order=true:strict_init_order=true
24 TSAN_OPTIONS: force_seq_cst_atomics=1
25
26 strategy:
27 fail-fast: false
28 matrix:
Stefanff693f72022-01-10 15:08:50 +010029 os: ["windows-2019", "windows-2022"]
30 compiler: ["cl", "clang", "clang-cl"]
Daan De Meyerf9726022019-10-10 22:16:49 +020031
32 include:
Stefanff693f72022-01-10 15:08:50 +010033 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020034 compiler: gcc
35 version: "4.8"
36
Stefanff693f72022-01-10 15:08:50 +010037 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020038 compiler: gcc
39 version: "4.9"
40
Stefanff693f72022-01-10 15:08:50 +010041 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020042 compiler: gcc
43 version: "5"
44
Stefanff693f72022-01-10 15:08:50 +010045 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020046 compiler: gcc
47 version: "6"
48
Stefanff693f72022-01-10 15:08:50 +010049 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020050 compiler: gcc
51 version: "7"
52
Stefanff693f72022-01-10 15:08:50 +010053 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020054 compiler: gcc
55 version: "8"
56
Stefanff693f72022-01-10 15:08:50 +010057 - os: ubuntu-latest
Daan De Meyerf9726022019-10-10 22:16:49 +020058 compiler: gcc
59 version: "9"
60
Stefanff693f72022-01-10 15:08:50 +010061 - os: ubuntu-latest
Viktor Kirilov0915b9d2020-12-16 11:57:51 +020062 compiler: gcc
63 version: "10"
64
Stefanff693f72022-01-10 15:08:50 +010065 - os: ubuntu-latest
66 compiler: gcc
67 version: "11"
68
69 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020070 compiler: clang
71 version: "3.5"
72
Stefanff693f72022-01-10 15:08:50 +010073 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020074 compiler: clang
75 version: "3.6"
76
Stefanff693f72022-01-10 15:08:50 +010077 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020078 compiler: clang
79 version: "3.7"
80
Stefanff693f72022-01-10 15:08:50 +010081 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020082 compiler: clang
83 version: "3.8"
84
Stefanff693f72022-01-10 15:08:50 +010085 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020086 compiler: clang
87 version: "3.9"
88
Stefanff693f72022-01-10 15:08:50 +010089 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020090 compiler: clang
91 version: "4.0"
92
Stefanff693f72022-01-10 15:08:50 +010093 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020094 compiler: clang
95 version: "5.0"
96
Stefanff693f72022-01-10 15:08:50 +010097 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +020098 compiler: clang
99 version: "6.0"
100
Stefanff693f72022-01-10 15:08:50 +0100101 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200102 compiler: clang
103 version: "7"
104
Stefanff693f72022-01-10 15:08:50 +0100105 - os: ubuntu-18.04
Daan De Meyerf9726022019-10-10 22:16:49 +0200106 compiler: clang
107 version: "8"
108
Stefanff693f72022-01-10 15:08:50 +0100109 - os: ubuntu-latest
110 compiler: clang
111 version: "9"
Daan De Meyerf9726022019-10-10 22:16:49 +0200112
Stefanff693f72022-01-10 15:08:50 +0100113 - os: ubuntu-latest
Viktor Kirilov0915b9d2020-12-16 11:57:51 +0200114 compiler: clang
115 version: "10"
116
Stefanff693f72022-01-10 15:08:50 +0100117 - os: ubuntu-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200118 compiler: clang
Stefanff693f72022-01-10 15:08:50 +0100119 version: "11"
Daan De Meyerf9726022019-10-10 22:16:49 +0200120
Stefanff693f72022-01-10 15:08:50 +0100121 - os: ubuntu-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200122 compiler: clang
Stefanff693f72022-01-10 15:08:50 +0100123 version: "12"
Daan De Meyerf9726022019-10-10 22:16:49 +0200124
Stefanff693f72022-01-10 15:08:50 +0100125 - os: ubuntu-latest
126 compiler: clang
127 version: "13"
Daan De Meyerf9726022019-10-10 22:16:49 +0200128
Stefanff693f72022-01-10 15:08:50 +0100129 - os: macOS-10.15
Clare Macrae8df12f22020-02-19 14:27:14 +0000130 compiler: xcode
Stefanff693f72022-01-10 15:08:50 +0100131 version: "10.3"
132
133 - os: macOS-latest
134 compiler: xcode
135 version: "11.7"
136
137 - os: macOS-latest
138 compiler: xcode
139 version: "12.5.1"
140
141 - os: macOS-latest
142 compiler: xcode
143 version: "13.2.1"
144
145 - os: macOS-latest
146 compiler: gcc
147 version: "11"
Daan De Meyerf9726022019-10-10 22:16:49 +0200148
149 steps:
Stefanff693f72022-01-10 15:08:50 +0100150 - uses: actions/checkout@v2
Daan De Meyerf9726022019-10-10 22:16:49 +0200151
152 - name: Install (Linux)
153 if: runner.os == 'Linux'
154 run: |
Daan De Meyer2e3d2652019-10-12 16:10:46 +0200155 # Required for libc6-dbg:i386 and g++-multilib packages which are
Daan De Meyerf9726022019-10-10 22:16:49 +0200156 # needed for x86 builds.
157 sudo dpkg --add-architecture i386
158
159 # clang-3.7 and earlier are not available in Bionic anymore so we get
160 # them from the Xenial repositories instead.
161 sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main"
162 sudo add-apt-repository "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe"
Daan De Meyer2e3d2652019-10-12 16:10:46 +0200163
Stefanff693f72022-01-10 15:08:50 +0100164 # clang->=13 is not currently available by default
165 if [ "${{ matrix.compiler }}" = "clang" -a ${{ matrix.version }} -ge 13 ]; then
166 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
167 sudo add-apt-repository "deb https://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.version }} main"
Daan De Meyerf9726022019-10-10 22:16:49 +0200168 fi
169
170 sudo apt-get update
171
172 # libc6-dbg:i386 is required for running valgrind on x86.
173 sudo apt-get install -y ninja-build valgrind libc6-dbg:i386
174
175 if [ "${{ matrix.compiler }}" = "gcc" ]; then
176 sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
Daan De Meyerf9726022019-10-10 22:16:49 +0200177 else
178 sudo apt-get install -y clang-${{ matrix.version }} g++-multilib
Daan De Meyerf9726022019-10-10 22:16:49 +0200179 fi
180
181 - name: Install (macOS)
182 if: runner.os == 'macOS'
183 run: |
Stefanff693f72022-01-10 15:08:50 +0100184 brew install ninja
185 if [ "${{ matrix.compiler }}" = "xcode" ]; then
186 sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
187 fi
Daan De Meyerf9726022019-10-10 22:16:49 +0200188
189 - name: Configure x64
Stefanff693f72022-01-10 15:08:50 +0100190 uses: ilammy/msvc-dev-cmd@v1
Daan De Meyerf9726022019-10-10 22:16:49 +0200191
Stefanff693f72022-01-10 15:08:50 +0100192 - name: Build & Test x64
193 run: python3 .github/workflows/build_and_test.py ${{ runner.os }} x64 ${{ matrix.compiler }} ${{ matrix.version }}
Daan De Meyerf9726022019-10-10 22:16:49 +0200194
195 - name: Configure x86
Stefanff693f72022-01-10 15:08:50 +0100196 uses: ilammy/msvc-dev-cmd@v1
197 with:
198 arch: x86
Daan De Meyerf9726022019-10-10 22:16:49 +0200199
Stefanff693f72022-01-10 15:08:50 +0100200 # MacOS doesn't support x86 from Xcode 10 onwards.
Daan De Meyerf9726022019-10-10 22:16:49 +0200201
Stefanff693f72022-01-10 15:08:50 +0100202 - name: Build & Test x86
203 if: runner.os == 'Linux' || runner.os == 'Windows' && matrix.compiler != 'clang-cl'
204 run: python3 .github/workflows/build_and_test.py ${{ runner.os }} x86 ${{ matrix.compiler }} ${{ matrix.version }}
Daan De Meyerf9726022019-10-10 22:16:49 +0200205
Stefanff693f72022-01-10 15:08:50 +0100206 ci-min-gw:
Stefan76cc1372022-01-18 00:17:46 +0100207 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Stefanff693f72022-01-10 15:08:50 +0100208 runs-on: windows-latest
Daan De Meyerf9726022019-10-10 22:16:49 +0200209
Stefanff693f72022-01-10 15:08:50 +0100210 strategy:
211 fail-fast: false
212 matrix:
213 configuration: ["Debug", "Release"]
Daan De Meyerf9726022019-10-10 22:16:49 +0200214
Stefanff693f72022-01-10 15:08:50 +0100215 steps:
216 - uses: actions/checkout@v2
217
218 - name: Set up MinGW
219 uses: egor-tensin/setup-mingw@v2
220
221 - name: Generate
222 run: cmake -B build -S . -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE=${{ matrix.configuration }}
223
224 - name: Build
225 run: cmake --build build
226
227 - name: Test
228 run: ctest --test-dir build --no-tests=error
229
230 ci-msvs:
Stefan76cc1372022-01-18 00:17:46 +0100231 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
Stefanff693f72022-01-10 15:08:50 +0100232 runs-on: ${{ matrix.toolset == 'v143' && 'windows-2022' || 'windows-latest' }}
233
234 strategy:
235 fail-fast: false
236 matrix:
237 toolset: ["v140", "v141", "v142", "v143", "ClangCl"]
238 architecture: ["Win32", "x64"]
239 configuration: ["Debug", "Release"]
240
241 steps:
242 - uses: actions/checkout@v2
243
244 - name: Generate
245 run: cmake -B build -S . -G "${{ matrix.toolset == 'v143' && 'Visual Studio 17 2022' || 'Visual Studio 16 2019' }}" \
246 -A ${{ matrix.architecture }} -T ${{ matrix.toolset }}
247
248 - name: Build
249 run: cmake --build build --config ${{ matrix.configuration }}
250
251 - name: Test
252 run: ctest -C ${{ matrix.configuration }} --test-dir build --no-tests=error