|
67 | 67 | path: EntropyCore-Windows-x64/** |
68 | 68 |
|
69 | 69 | build-and-test-linux: |
70 | | - name: Build and test (Linux, GCC) |
| 70 | + name: Build and test (Linux, GCC 14) |
71 | 71 | runs-on: ubuntu-24.04 |
72 | 72 | steps: |
73 | 73 | - name: Checkout |
|
76 | 76 | - name: Install prerequisites |
77 | 77 | run: | |
78 | 78 | sudo apt-get update |
79 | | - sudo apt-get install -y ninja-build g++ cmake |
| 79 | + sudo apt-get install -y ninja-build gcc-14 g++-14 cmake |
| 80 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 |
| 81 | + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 |
| 82 | + sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 100 |
| 83 | + sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 100 |
| 84 | + gcc --version |
| 85 | + g++ --version |
80 | 86 |
|
81 | 87 | - name: Setup vcpkg |
82 | 88 | uses: lukka/run-vcpkg@v11 |
@@ -270,3 +276,141 @@ jobs: |
270 | 276 | with: |
271 | 277 | name: EntropyCore-macOS-universal |
272 | 278 | path: EntropyCore-macOS-universal/** |
| 279 | + |
| 280 | + sanitizer-asan-ubsan: |
| 281 | + name: Sanitizer Tests (ASAN + UBSAN, GCC 14) |
| 282 | + runs-on: ubuntu-24.04 |
| 283 | + continue-on-error: true # Don't fail CI, but report issues |
| 284 | + steps: |
| 285 | + - name: Checkout |
| 286 | + uses: actions/checkout@v4 |
| 287 | + |
| 288 | + - name: Install prerequisites |
| 289 | + run: | |
| 290 | + sudo apt-get update |
| 291 | + sudo apt-get install -y ninja-build gcc-14 g++-14 cmake |
| 292 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 |
| 293 | + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 |
| 294 | + sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 100 |
| 295 | + sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 100 |
| 296 | + gcc --version |
| 297 | + g++ --version |
| 298 | +
|
| 299 | + - name: Setup vcpkg |
| 300 | + uses: lukka/run-vcpkg@v11 |
| 301 | + with: |
| 302 | + vcpkgGitCommitId: 'c59b04f668d20c7dd83f478835e8266a3cc51270' |
| 303 | + |
| 304 | + - name: Configure CMake with ASAN/UBSAN |
| 305 | + run: > |
| 306 | + cmake -S . -B build-asan -G Ninja |
| 307 | + -DCMAKE_BUILD_TYPE=Debug |
| 308 | + -DENTROPY_ENABLE_TESTS=ON |
| 309 | + -DENABLE_SANITIZERS=ON |
| 310 | + -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake |
| 311 | +
|
| 312 | + - name: Build tests with ASAN/UBSAN |
| 313 | + run: cmake --build build-asan --target EntropyCoreTests |
| 314 | + |
| 315 | + - name: Run tests with ASAN/UBSAN |
| 316 | + working-directory: build-asan |
| 317 | + run: ./EntropyCoreTests --gtest_brief=1 2>&1 | tee asan-ubsan-output.log |
| 318 | + continue-on-error: true # Capture failures but don't stop |
| 319 | + env: |
| 320 | + ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:detect_stack_use_after_return=1:strict_string_checks=1:detect_invalid_pointer_pairs=2:halt_on_error=1:abort_on_error=1 |
| 321 | + UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1:print_stacktrace=1 |
| 322 | + |
| 323 | + - name: Check for ASAN/UBSAN issues |
| 324 | + if: always() |
| 325 | + working-directory: build-asan |
| 326 | + run: | |
| 327 | + echo "## ASAN/UBSAN Results" >> $GITHUB_STEP_SUMMARY |
| 328 | + if grep -q "SUMMARY.*Sanitizer" asan-ubsan-output.log 2>/dev/null; then |
| 329 | + echo "⚠️ **Issues detected!**" >> $GITHUB_STEP_SUMMARY |
| 330 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 331 | + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |
| 332 | + grep -A 5 "SUMMARY.*Sanitizer" asan-ubsan-output.log | head -20 >> $GITHUB_STEP_SUMMARY |
| 333 | + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |
| 334 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 335 | + echo "📋 See full logs in artifacts: \`sanitizer-asan-ubsan-results\`" >> $GITHUB_STEP_SUMMARY |
| 336 | + else |
| 337 | + echo "✅ **No issues detected**" >> $GITHUB_STEP_SUMMARY |
| 338 | + fi |
| 339 | +
|
| 340 | + - name: Upload ASAN/UBSAN results |
| 341 | + if: always() # Always upload, even on success |
| 342 | + uses: actions/upload-artifact@v4 |
| 343 | + with: |
| 344 | + name: sanitizer-asan-ubsan-results |
| 345 | + path: | |
| 346 | + build-asan/asan-ubsan-output.log |
| 347 | + build-asan/**/*.log |
| 348 | +
|
| 349 | + sanitizer-tsan: |
| 350 | + name: Sanitizer Tests (TSAN, GCC 14) |
| 351 | + runs-on: ubuntu-24.04 |
| 352 | + continue-on-error: true # Don't fail CI, but report issues |
| 353 | + steps: |
| 354 | + - name: Checkout |
| 355 | + uses: actions/checkout@v4 |
| 356 | + |
| 357 | + - name: Install prerequisites |
| 358 | + run: | |
| 359 | + sudo apt-get update |
| 360 | + sudo apt-get install -y ninja-build gcc-14 g++-14 cmake |
| 361 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 |
| 362 | + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 |
| 363 | + sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 100 |
| 364 | + sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 100 |
| 365 | + gcc --version |
| 366 | + g++ --version |
| 367 | +
|
| 368 | + - name: Setup vcpkg |
| 369 | + uses: lukka/run-vcpkg@v11 |
| 370 | + with: |
| 371 | + vcpkgGitCommitId: 'c59b04f668d20c7dd83f478835e8266a3cc51270' |
| 372 | + |
| 373 | + - name: Configure CMake with TSAN |
| 374 | + run: > |
| 375 | + cmake -S . -B build-tsan -G Ninja |
| 376 | + -DCMAKE_BUILD_TYPE=Debug |
| 377 | + -DENTROPY_ENABLE_TESTS=ON |
| 378 | + -DENABLE_SANITIZERS=ON |
| 379 | + -DENABLE_TSAN=ON |
| 380 | + -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake |
| 381 | +
|
| 382 | + - name: Build tests with TSAN |
| 383 | + run: cmake --build build-tsan --target EntropyCoreTests |
| 384 | + |
| 385 | + - name: Run tests with TSAN |
| 386 | + working-directory: build-tsan |
| 387 | + run: ./EntropyCoreTests --gtest_brief=1 2>&1 | tee tsan-output.log |
| 388 | + continue-on-error: true # Capture failures but don't stop |
| 389 | + env: |
| 390 | + TSAN_OPTIONS: detect_deadlocks=1:second_deadlock_stack=1:history_size=7:io_sync=1:halt_on_error=1:abort_on_error=1 |
| 391 | + |
| 392 | + - name: Check for TSAN issues |
| 393 | + if: always() |
| 394 | + working-directory: build-tsan |
| 395 | + run: | |
| 396 | + echo "## TSAN Results" >> $GITHUB_STEP_SUMMARY |
| 397 | + if grep -q "WARNING.*ThreadSanitizer" tsan-output.log 2>/dev/null; then |
| 398 | + echo "⚠️ **Issues detected!**" >> $GITHUB_STEP_SUMMARY |
| 399 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 400 | + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |
| 401 | + grep -E "(WARNING.*ThreadSanitizer|SUMMARY.*ThreadSanitizer)" tsan-output.log | head -20 >> $GITHUB_STEP_SUMMARY |
| 402 | + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |
| 403 | + echo "" >> $GITHUB_STEP_SUMMARY |
| 404 | + echo "📋 See full logs in artifacts: \`sanitizer-tsan-results\`" >> $GITHUB_STEP_SUMMARY |
| 405 | + else |
| 406 | + echo "✅ **No issues detected**" >> $GITHUB_STEP_SUMMARY |
| 407 | + fi |
| 408 | +
|
| 409 | + - name: Upload TSAN results |
| 410 | + if: always() # Always upload, even on success |
| 411 | + uses: actions/upload-artifact@v4 |
| 412 | + with: |
| 413 | + name: sanitizer-tsan-results |
| 414 | + path: | |
| 415 | + build-tsan/tsan-output.log |
| 416 | + build-tsan/**/*.log |
0 commit comments