|
7 | 7 | branches: [master, staging] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - doctests: |
| 10 | + # ────────────────────────────────────────────── |
| 11 | + # Core test matrix: OS × SQLite |
| 12 | + # ────────────────────────────────────────────── |
| 13 | + tests: |
11 | 14 | runs-on: ${{ matrix.os }} |
12 | 15 | timeout-minutes: 120 |
13 | 16 | strategy: |
14 | 17 | fail-fast: false |
15 | 18 | matrix: |
16 | | - os: |
17 | | - - ubuntu-22.04 |
18 | | - - macos-15 |
19 | | - - windows-2022 |
20 | | - |
21 | | - include: |
| 19 | + os: [ubuntu-22.04, ubuntu-24.04, macos-15, windows-2022] |
| 20 | + sqlite: [OFF, ON] |
| 21 | + exclude: |
| 22 | + # Windows has no system sqlite3.lib |
22 | 23 | - os: windows-2022 |
23 | | - cmake-generator: -G "Visual Studio 17 2022" -A x64 |
24 | | - cmake-install: "" #Already installed on hosted runner |
25 | | - dependencies: "" #Already installed on hosted runner |
26 | | - make: msbuild countly-tests.vcxproj -t:rebuild -verbosity:diag -property:Configuration=Release && .\Release\countly-tests.exe |
27 | | - - os: macos-15 |
28 | | - cmake-install: "" #Already installed on hosted runner |
29 | | - dependencies: "" #Already installed on hosted runner |
30 | | - make: make ./countly-tests && ./countly-tests |
31 | | - - os: ubuntu-22.04 |
32 | | - cmake-install: "" #Already installed on hosted runner |
33 | | - dependencies: | |
34 | | - sudo apt-get update && sudo apt-get install -y \ |
35 | | - libcurl4-openssl-dev \ |
36 | | - libssl-dev |
37 | | - make: make ./countly-tests && ./countly-tests |
| 24 | + sqlite: ON |
38 | 25 |
|
39 | 26 | steps: |
40 | 27 | - name: Checkout code |
41 | | - uses: actions/checkout@v2 |
| 28 | + uses: actions/checkout@v4 |
42 | 29 | with: |
43 | 30 | submodules: "recursive" |
44 | 31 |
|
45 | | - - name: Update submodules |
46 | | - run: git submodule update --init --recursive |
| 32 | + - name: Install dependencies (Ubuntu) |
| 33 | + if: startsWith(matrix.os, 'ubuntu') |
| 34 | + run: | |
| 35 | + sudo apt-get update && sudo apt-get install -y \ |
| 36 | + libcurl4-openssl-dev \ |
| 37 | + libssl-dev \ |
| 38 | + libsqlite3-dev |
47 | 39 |
|
48 | | - - name: Install CMake |
49 | | - run: ${{ matrix.cmake-install }} |
| 40 | + - name: Set up MSVC |
| 41 | + if: matrix.os == 'windows-2022' |
| 42 | + uses: microsoft/setup-msbuild@v2 |
50 | 43 |
|
51 | | - - name: Install dependencies |
52 | | - run: ${{ matrix.dependencies }} |
| 44 | + - name: Configure (Unix) |
| 45 | + if: matrix.os != 'windows-2022' |
| 46 | + run: cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=${{ matrix.sqlite }} -B build . |
| 47 | + env: |
| 48 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
53 | 49 |
|
54 | | - - name: Set up MSVC |
| 50 | + - name: Configure (Windows) |
55 | 51 | if: matrix.os == 'windows-2022' |
56 | | - uses: microsoft/setup-msbuild@v1 |
| 52 | + run: cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=${{ matrix.sqlite }} -G "Visual Studio 17 2022" -A x64 -B build . |
| 53 | + env: |
| 54 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
| 55 | + |
| 56 | + - name: Build (Unix) |
| 57 | + if: matrix.os != 'windows-2022' |
| 58 | + run: cd build && make ./countly-tests |
| 59 | + |
| 60 | + - name: Build (Windows) |
| 61 | + if: matrix.os == 'windows-2022' |
| 62 | + run: cd build && msbuild countly-tests.vcxproj -t:rebuild -verbosity:minimal -property:Configuration=Release |
| 63 | + |
| 64 | + - name: Run tests (Unix) |
| 65 | + if: matrix.os != 'windows-2022' |
| 66 | + run: cd build && ./countly-tests |
| 67 | + |
| 68 | + - name: Run tests (Windows) |
| 69 | + if: matrix.os == 'windows-2022' |
| 70 | + run: cd build && .\Release\countly-tests.exe |
| 71 | + |
| 72 | + # ────────────────────────────────────────────── |
| 73 | + # Sanitizers (Linux only, with SQLite) |
| 74 | + # ────────────────────────────────────────────── |
| 75 | + sanitizer-asan: |
| 76 | + runs-on: ubuntu-22.04 |
| 77 | + timeout-minutes: 120 |
| 78 | + steps: |
| 79 | + - name: Checkout code |
| 80 | + uses: actions/checkout@v4 |
| 81 | + with: |
| 82 | + submodules: "recursive" |
| 83 | + |
| 84 | + - name: Install dependencies |
| 85 | + run: | |
| 86 | + sudo apt-get update && sudo apt-get install -y \ |
| 87 | + libcurl4-openssl-dev \ |
| 88 | + libssl-dev \ |
| 89 | + libsqlite3-dev |
| 90 | +
|
| 91 | + - name: Configure with ASAN |
| 92 | + run: | |
| 93 | + cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \ |
| 94 | + -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer" \ |
| 95 | + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" \ |
| 96 | + -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address" \ |
| 97 | + -B build . |
| 98 | + env: |
| 99 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
| 100 | + |
| 101 | + - name: Build |
| 102 | + run: cd build && make ./countly-tests |
| 103 | + |
| 104 | + - name: Run tests |
| 105 | + run: cd build && ./countly-tests |
| 106 | + env: |
| 107 | + ASAN_OPTIONS: "detect_leaks=1" |
| 108 | + |
| 109 | + sanitizer-tsan: |
| 110 | + runs-on: ubuntu-22.04 |
| 111 | + timeout-minutes: 120 |
| 112 | + # TSAN detects known threading issues tracked for future refactor. |
| 113 | + # Runs for visibility but does not block the pipeline. |
| 114 | + continue-on-error: true |
| 115 | + steps: |
| 116 | + - name: Checkout code |
| 117 | + uses: actions/checkout@v4 |
| 118 | + with: |
| 119 | + submodules: "recursive" |
| 120 | + |
| 121 | + - name: Install dependencies |
| 122 | + run: | |
| 123 | + sudo apt-get update && sudo apt-get install -y \ |
| 124 | + libcurl4-openssl-dev \ |
| 125 | + libssl-dev \ |
| 126 | + libsqlite3-dev |
| 127 | +
|
| 128 | + - name: Configure with TSAN |
| 129 | + run: | |
| 130 | + cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \ |
| 131 | + -DCMAKE_CXX_FLAGS="-fsanitize=thread" \ |
| 132 | + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ |
| 133 | + -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ |
| 134 | + -B build . |
| 135 | + env: |
| 136 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
| 137 | + |
| 138 | + - name: Build |
| 139 | + run: cd build && make ./countly-tests |
| 140 | + |
| 141 | + - name: Run tests |
| 142 | + run: cd build && ./countly-tests |
| 143 | + env: |
| 144 | + TSAN_OPTIONS: "second_deadlock_stack=1" |
| 145 | + |
| 146 | + sanitizer-ubsan: |
| 147 | + runs-on: ubuntu-22.04 |
| 148 | + timeout-minutes: 120 |
| 149 | + steps: |
| 150 | + - name: Checkout code |
| 151 | + uses: actions/checkout@v4 |
| 152 | + with: |
| 153 | + submodules: "recursive" |
| 154 | + |
| 155 | + - name: Install dependencies |
| 156 | + run: | |
| 157 | + sudo apt-get update && sudo apt-get install -y \ |
| 158 | + libcurl4-openssl-dev \ |
| 159 | + libssl-dev \ |
| 160 | + libsqlite3-dev |
57 | 161 |
|
58 | | - - name: Build and run tests |
| 162 | + - name: Configure with UBSAN |
59 | 163 | run: | |
60 | | - cmake -DCOUNTLY_BUILD_TESTS=1 -B build . ${{ matrix.cmake-generator }} |
61 | | - cd build |
62 | | - ${{ matrix.make }} |
| 164 | + cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \ |
| 165 | + -DCMAKE_CXX_FLAGS="-fsanitize=undefined -fno-sanitize-recover=all" \ |
| 166 | + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=undefined" \ |
| 167 | + -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=undefined" \ |
| 168 | + -B build . |
| 169 | + env: |
| 170 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
| 171 | + |
| 172 | + - name: Build |
| 173 | + run: cd build && make ./countly-tests |
| 174 | + |
| 175 | + - name: Run tests |
| 176 | + run: cd build && ./countly-tests |
63 | 177 | env: |
64 | | - CMAKE_POLICY_VERSION_MINIMUM: 3.31 |
| 178 | + UBSAN_OPTIONS: "print_stacktrace=1" |
| 179 | + |
| 180 | + # ────────────────────────────────────────────── |
| 181 | + # Static library build (custom HTTP, no curl) |
| 182 | + # ────────────────────────────────────────────── |
| 183 | + static-build: |
| 184 | + runs-on: ubuntu-22.04 |
| 185 | + timeout-minutes: 120 |
| 186 | + steps: |
| 187 | + - name: Checkout code |
| 188 | + uses: actions/checkout@v4 |
| 189 | + with: |
| 190 | + submodules: "recursive" |
| 191 | + |
| 192 | + - name: Install dependencies |
| 193 | + run: | |
| 194 | + sudo apt-get update && sudo apt-get install -y \ |
| 195 | + libssl-dev \ |
| 196 | + libsqlite3-dev |
| 197 | +
|
| 198 | + - name: Configure static build |
| 199 | + run: | |
| 200 | + cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \ |
| 201 | + -DBUILD_SHARED_LIBS=OFF -DCOUNTLY_USE_CUSTOM_HTTP=ON \ |
| 202 | + -B build . |
| 203 | + env: |
| 204 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
| 205 | + |
| 206 | + - name: Build |
| 207 | + run: cd build && make ./countly-tests |
| 208 | + |
| 209 | + - name: Run tests |
| 210 | + run: cd build && ./countly-tests |
| 211 | + |
| 212 | + # ────────────────────────────────────────────── |
| 213 | + # C++17 compatibility check |
| 214 | + # ────────────────────────────────────────────── |
| 215 | + cpp17: |
| 216 | + runs-on: ubuntu-24.04 |
| 217 | + timeout-minutes: 120 |
| 218 | + steps: |
| 219 | + - name: Checkout code |
| 220 | + uses: actions/checkout@v4 |
| 221 | + with: |
| 222 | + submodules: "recursive" |
| 223 | + |
| 224 | + - name: Install dependencies |
| 225 | + run: | |
| 226 | + sudo apt-get update && sudo apt-get install -y \ |
| 227 | + libcurl4-openssl-dev \ |
| 228 | + libssl-dev \ |
| 229 | + libsqlite3-dev |
| 230 | +
|
| 231 | + - name: Configure with C++17 |
| 232 | + run: | |
| 233 | + cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \ |
| 234 | + -DCMAKE_CXX_STANDARD=17 \ |
| 235 | + -B build . |
| 236 | + env: |
| 237 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
| 238 | + |
| 239 | + - name: Build |
| 240 | + run: cd build && make ./countly-tests |
| 241 | + |
| 242 | + - name: Run tests |
| 243 | + run: cd build && ./countly-tests |
| 244 | + |
| 245 | + # ────────────────────────────────────────────── |
| 246 | + # Clang on Linux |
| 247 | + # ────────────────────────────────────────────── |
| 248 | + clang-linux: |
| 249 | + runs-on: ubuntu-24.04 |
| 250 | + timeout-minutes: 120 |
| 251 | + steps: |
| 252 | + - name: Checkout code |
| 253 | + uses: actions/checkout@v4 |
| 254 | + with: |
| 255 | + submodules: "recursive" |
| 256 | + |
| 257 | + - name: Install dependencies |
| 258 | + run: | |
| 259 | + sudo apt-get update && sudo apt-get install -y \ |
| 260 | + clang \ |
| 261 | + libcurl4-openssl-dev \ |
| 262 | + libssl-dev \ |
| 263 | + libsqlite3-dev |
| 264 | +
|
| 265 | + - name: Configure with Clang |
| 266 | + run: | |
| 267 | + cmake -DCOUNTLY_BUILD_TESTS=1 -DCOUNTLY_USE_SQLITE=ON \ |
| 268 | + -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ |
| 269 | + -B build . |
| 270 | + env: |
| 271 | + CMAKE_POLICY_VERSION_MINIMUM: "3.31" |
| 272 | + |
| 273 | + - name: Build |
| 274 | + run: cd build && make ./countly-tests |
| 275 | + |
| 276 | + - name: Run tests |
| 277 | + run: cd build && ./countly-tests |
0 commit comments