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: |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 11 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 12 | env: |
| 13 | CTEST_OUTPUT_ON_FAILURE: ON |
| 14 | CTEST_PARALLEL_LEVEL: 2 |
| 15 | |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 16 | jobs: |
| 17 | ci: |
Stefan | 76cc137 | 2022-01-18 00:17:46 +0100 | [diff] [blame] | 18 | 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] | 19 | 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: |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 29 | os: ["windows-2019", "windows-2022"] |
| 30 | compiler: ["cl", "clang", "clang-cl"] |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 31 | |
| 32 | include: |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 33 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 34 | compiler: gcc |
| 35 | version: "4.8" |
| 36 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 37 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 38 | compiler: gcc |
| 39 | version: "4.9" |
| 40 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 41 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 42 | compiler: gcc |
| 43 | version: "5" |
| 44 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 45 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 46 | compiler: gcc |
| 47 | version: "6" |
| 48 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 49 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 50 | compiler: gcc |
| 51 | version: "7" |
| 52 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 53 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 54 | compiler: gcc |
| 55 | version: "8" |
| 56 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 57 | - os: ubuntu-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 58 | compiler: gcc |
| 59 | version: "9" |
| 60 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 61 | - os: ubuntu-latest |
Viktor Kirilov | 0915b9d | 2020-12-16 11:57:51 +0200 | [diff] [blame] | 62 | compiler: gcc |
| 63 | version: "10" |
| 64 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 65 | - os: ubuntu-latest |
| 66 | compiler: gcc |
| 67 | version: "11" |
| 68 | |
| 69 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 70 | compiler: clang |
| 71 | version: "3.5" |
| 72 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 73 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 74 | compiler: clang |
| 75 | version: "3.6" |
| 76 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 77 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 78 | compiler: clang |
| 79 | version: "3.7" |
| 80 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 81 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 82 | compiler: clang |
| 83 | version: "3.8" |
| 84 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 85 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 86 | compiler: clang |
| 87 | version: "3.9" |
| 88 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 89 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 90 | compiler: clang |
| 91 | version: "4.0" |
| 92 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 93 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 94 | compiler: clang |
| 95 | version: "5.0" |
| 96 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 97 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 98 | compiler: clang |
| 99 | version: "6.0" |
| 100 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 101 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 102 | compiler: clang |
| 103 | version: "7" |
| 104 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 105 | - os: ubuntu-18.04 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 106 | compiler: clang |
| 107 | version: "8" |
| 108 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 109 | - os: ubuntu-latest |
| 110 | compiler: clang |
| 111 | version: "9" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 112 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 113 | - os: ubuntu-latest |
Viktor Kirilov | 0915b9d | 2020-12-16 11:57:51 +0200 | [diff] [blame] | 114 | compiler: clang |
| 115 | version: "10" |
| 116 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 117 | - os: ubuntu-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 118 | compiler: clang |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 119 | version: "11" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 120 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 121 | - os: ubuntu-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 122 | compiler: clang |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 123 | version: "12" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 124 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 125 | - os: ubuntu-latest |
| 126 | compiler: clang |
| 127 | version: "13" |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 128 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 129 | - os: macOS-10.15 |
Clare Macrae | 8df12f2 | 2020-02-19 14:27:14 +0000 | [diff] [blame] | 130 | compiler: xcode |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 131 | 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 148 | |
| 149 | steps: |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 150 | - uses: actions/checkout@v2 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 151 | |
| 152 | - name: Install (Linux) |
| 153 | if: runner.os == 'Linux' |
| 154 | run: | |
Daan De Meyer | 2e3d265 | 2019-10-12 16:10:46 +0200 | [diff] [blame] | 155 | # Required for libc6-dbg:i386 and g++-multilib packages which are |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 156 | # 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 Meyer | 2e3d265 | 2019-10-12 16:10:46 +0200 | [diff] [blame] | 163 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 164 | # 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 168 | 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 177 | else |
| 178 | sudo apt-get install -y clang-${{ matrix.version }} g++-multilib |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 179 | fi |
| 180 | |
| 181 | - name: Install (macOS) |
| 182 | if: runner.os == 'macOS' |
| 183 | run: | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 184 | brew install ninja |
| 185 | if [ "${{ matrix.compiler }}" = "xcode" ]; then |
| 186 | sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app |
| 187 | fi |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 188 | |
| 189 | - name: Configure x64 |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 190 | uses: ilammy/msvc-dev-cmd@v1 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 191 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 192 | - name: Build & Test x64 |
| 193 | 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] | 194 | |
| 195 | - name: Configure x86 |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 196 | uses: ilammy/msvc-dev-cmd@v1 |
| 197 | with: |
| 198 | arch: x86 |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 199 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 200 | # MacOS doesn't support x86 from Xcode 10 onwards. |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 201 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 202 | - 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 Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 205 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 206 | ci-min-gw: |
Stefan | 76cc137 | 2022-01-18 00:17:46 +0100 | [diff] [blame] | 207 | 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] | 208 | runs-on: windows-latest |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 209 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 210 | strategy: |
| 211 | fail-fast: false |
| 212 | matrix: |
| 213 | configuration: ["Debug", "Release"] |
Daan De Meyer | f972602 | 2019-10-10 22:16:49 +0200 | [diff] [blame] | 214 | |
Stefan | ff693f7 | 2022-01-10 15:08:50 +0100 | [diff] [blame] | 215 | 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: |
Stefan | 76cc137 | 2022-01-18 00:17:46 +0100 | [diff] [blame] | 231 | 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] | 232 | 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 |