|
| 1 | +on: |
| 2 | + workflow_dispatch: # allow running the workflow manually |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - 'dev*' |
| 6 | + tags: |
| 7 | + - 'v*' |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true # Cancel any in-progress runs of this workflow when a new run is triggered on the same ref (branch or tag) |
| 12 | + |
| 13 | +name: Test |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: Test |
| 17 | + runs-on: ${{ matrix.os }} |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + tests: [basic,extra] |
| 21 | + os: [windows-latest, macos-latest, ubuntu-latest, macos-14, macos-15-intel, ubuntu-22.04-arm, windows-11-arm] |
| 22 | + exclude: |
| 23 | + - os: macos-14 |
| 24 | + tests: extra |
| 25 | + |
| 26 | + steps: |
| 27 | + # Checkout: https://github.com/actions/checkout |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v6 |
| 30 | + |
| 31 | + # Basic |
| 32 | + - name: Debug |
| 33 | + if: matrix.tests == 'basic' |
| 34 | + run: | |
| 35 | + cmake . -B out/debug -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON |
| 36 | + cmake --build out/debug --parallel 4 --config Debug |
| 37 | + ctest --test-dir out/debug --verbose --timeout 240 -C Debug |
| 38 | +
|
| 39 | + - name: Release |
| 40 | + if: matrix.tests == 'basic' |
| 41 | + run: | |
| 42 | + cmake . -B out/release -DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON |
| 43 | + cmake --build out/release --parallel 4 --config Release |
| 44 | + ctest --test-dir out/release --verbose --timeout 240 -C Release |
| 45 | +
|
| 46 | + - name: Secure |
| 47 | + if: matrix.tests == 'basic' |
| 48 | + run: | |
| 49 | + cmake . -B out/secure -DCMAKE_BUILD_TYPE=Release -DMI_SECURE=ON |
| 50 | + cmake --build out/secure --parallel 4 --config Release |
| 51 | + ctest --test-dir out/secure --verbose --timeout 240 -C Release |
| 52 | +
|
| 53 | + # Basic, C++ |
| 54 | + - name: Debug, C++ |
| 55 | + if: matrix.tests == 'basic' && runner.os != 'Windows' # windows already uses C++ by default |
| 56 | + run: | |
| 57 | + cmake . -B out/debug-cxx -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON |
| 58 | + cmake --build out/debug-cxx --parallel 8 --config Debug |
| 59 | + ctest --test-dir out/debug-cxx --verbose --timeout 240 -C Debug |
| 60 | +
|
| 61 | + - name: Release, C++ |
| 62 | + if: matrix.tests == 'basic' && runner.os == 'Linux' # windows already uses C++ by default; macOS interpose does not work well with C++ |
| 63 | + run: | |
| 64 | + cmake . -B out/release-cxx -DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON -DMI_USE_CXX=ON |
| 65 | + cmake --build out/release-cxx --parallel 8 --config Release |
| 66 | + ctest --test-dir out/release-cxx --verbose --timeout 240 -C Release |
| 67 | +
|
| 68 | + # Extra, Windows x86 |
| 69 | + - name: Debug, Win32 |
| 70 | + if: matrix.tests == 'extra' && runner.os == 'Windows' && !endsWith(matrix.os,'arm') |
| 71 | + run: | |
| 72 | + cmake . -B out/debug-x86 -DCMAKE_BUILD_TYPE=Debug -A Win32 |
| 73 | + cmake --build out/debug-x86 --parallel 4 --config Debug |
| 74 | + ctest --test-dir out/debug-x86 --verbose --timeout 240 -C Debug |
| 75 | +
|
| 76 | + - name: Release, Win32 |
| 77 | + if: matrix.tests == 'extra' && runner.os == 'Windows' && !endsWith(matrix.os,'arm') |
| 78 | + run: | |
| 79 | + cmake . -B out/release-x86 -DCMAKE_BUILD_TYPE=Release -A Win32 |
| 80 | + cmake --build out/release-x86 --parallel 4 --config Release |
| 81 | + ctest --test-dir out/release-x86 --verbose --timeout 240 -C Release |
| 82 | +
|
| 83 | + - name: Debug, clang-cl |
| 84 | + if: matrix.tests == 'extra' && runner.os == 'Windows' && !endsWith(matrix.os,'arm') |
| 85 | + run: | |
| 86 | + cmake . -B out/debug-clang -DCMAKE_BUILD_TYPE=Debug -A Win32 -T ClangCl |
| 87 | + cmake --build out/debug-clang --parallel 4 --config Debug |
| 88 | + ctest --test-dir out/debug-clang --verbose --timeout 240 -C Debug |
| 89 | +
|
| 90 | + - name: Release, clang-cl |
| 91 | + if: matrix.tests == 'extra' && runner.os == 'Windows' && !endsWith(matrix.os,'arm') |
| 92 | + run: | |
| 93 | + cmake . -B out/release-clang -DCMAKE_BUILD_TYPE=Release -A Win32 -T ClangCl |
| 94 | + cmake --build out/release-clang --parallel 4 --config Release |
| 95 | + ctest --test-dir out/release-clang --verbose --timeout 240 -C Release |
| 96 | +
|
| 97 | + # Extra |
| 98 | + - name: Release, SIMD |
| 99 | + if: matrix.tests == 'extra' |
| 100 | + run: | |
| 101 | + cmake . -B out/release-simd -DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON -DMI_OPT_SIMD=ON |
| 102 | + cmake --build out/release-simd --parallel 8 --config Release |
| 103 | + ctest --test-dir out/release-simd --verbose --timeout 240 -C Release |
| 104 | +
|
| 105 | + - name: Release, C++, SIMD |
| 106 | + if: matrix.tests == 'basic' && runner.os != 'Windows' && runner.os != 'macOS' |
| 107 | + run: | |
| 108 | + cmake . -B out/release-cxx -DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON -DMI_OPT_SIMD=ON -DMI_USE_CXX=ON |
| 109 | + cmake --build out/release-cxx --parallel 8 --config Release |
| 110 | + ctest --test-dir out/release-cxx --verbose --timeout 240 -C Release |
| 111 | +
|
| 112 | + - name: Debug, C++, clang++ |
| 113 | + if: matrix.tests == 'extra' && runner.os == 'Linux' |
| 114 | + run: | |
| 115 | + CC=clang CXX=clang++ cmake . -B out/debug-clang-cxx -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON |
| 116 | + cmake --build out/debug-clang-cxx --parallel 8 --config Debug |
| 117 | + ctest --test-dir out/debug-clang-cxx --verbose --timeout 240 -C Debug |
| 118 | +
|
| 119 | + - name: Release, C++, clang++ |
| 120 | + if: matrix.tests == 'extra' && runner.os == 'Linux' |
| 121 | + run: | |
| 122 | + CC=clang CXX=clang++ cmake . -B out/release-clang-cxx -DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON -DMI_USE_CXX=ON |
| 123 | + cmake --build out/release-clang-cxx --parallel 8 --config Release |
| 124 | + ctest --test-dir out/release-clang-cxx --verbose --timeout 240 -C Release |
| 125 | +
|
| 126 | + - name: Debug, ASAN |
| 127 | + if: matrix.tests == 'extra' && runner.os == 'Linux' |
| 128 | + run: | |
| 129 | + CC=clang CXX=clang++ cmake . -B out/debug-asan -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_TRACK_ASAN=ON |
| 130 | + cmake --build out/debug-asan --parallel 8 --config Debug |
| 131 | + ctest --test-dir out/debug-asan --verbose --timeout 240 -C Debug |
| 132 | +
|
| 133 | + - name: Debug, UBSAN |
| 134 | + if: matrix.tests == 'extra' && runner.os == 'Linux' |
| 135 | + run: | |
| 136 | + CC=clang CXX=clang++ cmake . -B out/debug-ubsan -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_DEBUG_UBSAN=ON |
| 137 | + cmake --build out/debug-ubsan --parallel 8 --config Debug |
| 138 | + ctest --test-dir out/debug-ubsan --verbose --timeout 240 -C Debug |
| 139 | +
|
| 140 | + - name: Debug, TSAN |
| 141 | + if: matrix.tests == 'extra' && runner.os == 'Linux' |
| 142 | + run: | |
| 143 | + CC=clang CXX=clang++ cmake . -B out/debug-tsan -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_DEBUG_TSAN=ON |
| 144 | + cmake --build out/debug-tsan --parallel 8 --config Debug |
| 145 | + ctest --test-dir out/debug-tsan --verbose --timeout 240 -C Debug |
| 146 | +
|
| 147 | + - name: Debug, Guarded |
| 148 | + if: matrix.tests == 'extra' && matrix.os != 'windows-11-arm' && runner.os != 'macOS' |
| 149 | + run: | |
| 150 | + cmake . -B out/debug-guarded -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_GUARDED=ON |
| 151 | + cmake --build out/debug-guarded --parallel 8 --config Debug |
| 152 | + ctest --test-dir out/debug-guarded --verbose --timeout 240 -C Debug |
| 153 | + env: |
| 154 | + MIMALLOC_GUARDED_SAMPLE_RATE: 100 |
| 155 | + |
| 156 | + - name: Release, Guarded |
| 157 | + if: matrix.tests == 'extra' && runner.os == 'Linux' && startsWith(github.ref_name,'dev3') |
| 158 | + run: | |
| 159 | + cmake . -B out/release-guarded -DCMAKE_BUILD_TYPE=Release -DMI_OPT_ARCH=ON -DMI_GUARDED=ON |
| 160 | + cmake --build out/release-guarded --parallel 8 --config Release |
| 161 | + ctest --test-dir out/release-guarded --verbose --timeout 240 -C Release |
| 162 | + env: |
| 163 | + MIMALLOC_GUARDED_SAMPLE_RATE: 100 |
0 commit comments