Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 1 | name: CI |
| 2 | |
Stefan | 2ef137d | 2022-01-11 20:33:39 +0100 | [diff] [blame] | 3 | on: |
| 4 | push: |
| 5 | paths-ignore: |
| 6 | - 'doc/**' |
| 7 | - 'scripts/**' |
| 8 | - 'LICENSE.txt' |
| 9 | - 'README.md' |
Stefan | aaa7253 | 2022-01-18 00:16:44 +0100 | [diff] [blame] | 10 | pull_request: |
Salvage | a212438 | 2022-01-24 21:32:39 +0100 | [diff] [blame] | 11 | paths-ignore: |
| 12 | - 'doc/**' |
| 13 | - 'scripts/**' |
| 14 | - 'LICENSE.txt' |
| 15 | - 'README.md' |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 16 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 17 | env: |
| 18 | CTEST_OUTPUT_ON_FAILURE: ON |
| 19 | CTEST_PARALLEL_LEVEL: 2 |
| 20 | |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 21 | jobs: |
Stefan | bf037c1 | 2022-01-20 13:06:51 +0100 | [diff] [blame] | 22 | coverage: |
Stefan | bf037c1 | 2022-01-20 13:06:51 +0100 | [diff] [blame] | 23 | runs-on: ubuntu-latest |
Stefan | db758e0 | 2022-06-06 03:42:02 +0200 | [diff] [blame] | 24 | |
Stefan | bf037c1 | 2022-01-20 13:06:51 +0100 | [diff] [blame] | 25 | steps: |
| 26 | - uses: actions/checkout@v2 |
Stefan | db758e0 | 2022-06-06 03:42:02 +0200 | [diff] [blame] | 27 | |
Stefan | bf037c1 | 2022-01-20 13:06:51 +0100 | [diff] [blame] | 28 | - name: Install |
| 29 | run: sudo apt-get install -y ninja-build lcov |
Stefan | db758e0 | 2022-06-06 03:42:02 +0200 | [diff] [blame] | 30 | |
Stefan | bf037c1 | 2022-01-20 13:06:51 +0100 | [diff] [blame] | 31 | - 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 |
Stefan | db758e0 | 2022-06-06 03:42:02 +0200 | [diff] [blame] | 39 | |
Stefan | bf037c1 | 2022-01-20 13:06:51 +0100 | [diff] [blame] | 40 | - name: LCOV |
| 41 | run: | |
| 42 | mkdir coverage |
| 43 | lcov -c -d build/ -o coverage/lcov.info --include "*doctest/parts*" |
Stefan | db758e0 | 2022-06-06 03:42:02 +0200 | [diff] [blame] | 44 | |
Stefan | bf037c1 | 2022-01-20 13:06:51 +0100 | [diff] [blame] | 45 | - name: Codecov |
| 46 | uses: codecov/codecov-action@v2 |
| 47 | with: |
| 48 | files: ./coverage/lcov.info |
| 49 | fail_ci_if_error: true |
| 50 | |
Stefan | db758e0 | 2022-06-06 03:42:02 +0200 | [diff] [blame] | 51 | 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 Nason | 4e38208 | 2022-10-03 07:45:43 -0700 | [diff] [blame] | 67 | 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 91 | ci: |
Stefan | 76cc137 | 2022-01-18 00:17:46 +0100 | [diff] [blame] | 92 | if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 93 | 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: |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 103 | os: ["windows-2019", "windows-2022"] |
| 104 | compiler: ["cl", "clang", "clang-cl"] |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 105 | |
| 106 | include: |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 107 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 108 | compiler: gcc |
| 109 | version: "4.8" |
| 110 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 111 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 112 | compiler: gcc |
| 113 | version: "4.9" |
| 114 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 115 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 116 | compiler: gcc |
| 117 | version: "5" |
| 118 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 119 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 120 | compiler: gcc |
| 121 | version: "6" |
| 122 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 123 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 124 | compiler: gcc |
| 125 | version: "7" |
| 126 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 127 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 128 | compiler: gcc |
| 129 | version: "8" |
| 130 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 131 | - os: ubuntu-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 132 | compiler: gcc |
| 133 | version: "9" |
| 134 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 135 | - os: ubuntu-latest |
Viktor Kirilov | 0915b9d | 2020-12-16 11:57:51 +0200 | [diff] [blame] | 136 | compiler: gcc |
| 137 | version: "10" |
| 138 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 139 | - os: ubuntu-latest |
| 140 | compiler: gcc |
| 141 | version: "11" |
| 142 | |
| 143 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 144 | compiler: clang |
| 145 | version: "3.5" |
| 146 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 147 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 148 | compiler: clang |
| 149 | version: "3.6" |
| 150 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 151 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 152 | compiler: clang |
| 153 | version: "3.7" |
| 154 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 155 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 156 | compiler: clang |
| 157 | version: "3.8" |
| 158 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 159 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 160 | compiler: clang |
| 161 | version: "3.9" |
| 162 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 163 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 164 | compiler: clang |
| 165 | version: "4.0" |
| 166 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 167 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 168 | compiler: clang |
| 169 | version: "5.0" |
| 170 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 171 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 172 | compiler: clang |
| 173 | version: "6.0" |
| 174 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 175 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 176 | compiler: clang |
| 177 | version: "7" |
| 178 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 179 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 180 | compiler: clang |
| 181 | version: "8" |
| 182 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 183 | - os: ubuntu-latest |
| 184 | compiler: clang |
| 185 | version: "9" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 186 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 187 | - os: ubuntu-latest |
Viktor Kirilov | 0915b9d | 2020-12-16 11:57:51 +0200 | [diff] [blame] | 188 | compiler: clang |
| 189 | version: "10" |
| 190 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 191 | - os: ubuntu-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 192 | compiler: clang |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 193 | version: "11" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 194 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 195 | - os: ubuntu-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 196 | compiler: clang |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 197 | version: "12" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 198 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 199 | - os: ubuntu-latest |
| 200 | compiler: clang |
| 201 | version: "13" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 202 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 203 | - os: macOS-10.15 |
Clare Macrae | 8df12f2 | 2020-02-19 14:27:14 +0000 | [diff] [blame] | 204 | compiler: xcode |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 205 | 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 222 | |
| 223 | steps: |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 224 | - uses: actions/checkout@v2 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 225 | |
| 226 | - name: Install (Linux) |
| 227 | if: runner.os == 'Linux' |
| 228 | run: | |
Daan De Meyer | 2e3d265 | 2019-10-12 16:10:46 +0200 | [diff] [blame] | 229 | # Required for libc6-dbg:i386 and g++-multilib packages which are |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 230 | # 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 Meyer | 2e3d265 | 2019-10-12 16:10:46 +0200 | [diff] [blame] | 237 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 238 | # 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 242 | 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 251 | else |
| 252 | sudo apt-get install -y clang-${{ matrix.version }} g++-multilib |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 253 | fi |
| 254 | |
| 255 | - name: Install (macOS) |
| 256 | if: runner.os == 'macOS' |
| 257 | run: | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 258 | brew install ninja |
| 259 | if [ "${{ matrix.compiler }}" = "xcode" ]; then |
| 260 | sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app |
| 261 | fi |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 262 | |
| 263 | - name: Configure x64 |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 264 | uses: ilammy/msvc-dev-cmd@v1 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 265 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 266 | - name: Build & Test x64 |
| 267 | run: python3 .github/workflows/build_and_test.py ${{ runner.os }} x64 ${{ matrix.compiler }} ${{ matrix.version }} |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 268 | |
| 269 | - name: Configure x86 |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 270 | uses: ilammy/msvc-dev-cmd@v1 |
| 271 | with: |
| 272 | arch: x86 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 273 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 274 | # MacOS doesn't support x86 from Xcode 10 onwards. |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 275 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 276 | - 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 279 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 280 | ci-min-gw: |
Stefan | 76cc137 | 2022-01-18 00:17:46 +0100 | [diff] [blame] | 281 | if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 282 | runs-on: windows-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 283 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 284 | strategy: |
| 285 | fail-fast: false |
| 286 | matrix: |
| 287 | configuration: ["Debug", "Release"] |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 288 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 289 | 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: |
Stefan | 76cc137 | 2022-01-18 00:17:46 +0100 | [diff] [blame] | 305 | if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
Stefan | f54a4e4 | 2022-02-14 18:22:45 +0100 | [diff] [blame] | 306 | runs-on: ${{ matrix.toolset == 'v143' && 'windows-2022' || 'windows-2019' }} |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 307 | |
| 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 |
Stefan | db758e0 | 2022-06-06 03:42:02 +0200 | [diff] [blame] | 317 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 318 | - 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 |