name: Ubuntu 24.04 Sanitized CI (GCC 13)

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  ubuntu-build:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v6
      - name: Use cmake with address sanitizer
        run: |
          mkdir build &&
          cd build &&
          cmake -DSIMDUTF_CXX_STANDARD=20 -DSIMDUTF_ATOMIC_BASE64_TESTS=ON  -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=ON -DSIMDUTF_SANITIZE=ON .. -DSIMDUTF_FAST_TESTS=On &&
          cmake --build . --parallel $(nproc)  &&
          ctest --output-on-failure --parallel $(nproc)
      - name: Use cmake with undefined behavior sanitizer
        run: |
          mkdir buildundef &&
          cd buildundef &&
          cmake -DSIMDUTF_CXX_STANDARD=20  -DSIMDUTF_ATOMIC_BASE64_TESTS=ON -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=ON -DSIMDUTF_SANITIZE_UNDEFINED=ON .. -DSIMDUTF_FAST_TESTS=On &&
          cmake --build . --parallel $(nproc)  &&
          ctest --output-on-failure --parallel $(nproc)
      - name: Use cmake with thread sanitizer
        run: |
          mkdir buildthread &&
          cd buildthread &&
          cmake -DSIMDUTF_CXX_STANDARD=20  -DSIMDUTF_ATOMIC_BASE64_TESTS=ON -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=ON -DSIMDUTF_SANITIZE_THREAD=ON .. -DSIMDUTF_FAST_TESTS=On &&
          cmake --build .  --parallel $(nproc) &&
          ctest --output-on-failure --parallel $(nproc)
