name: Ubuntu 24.04 Sanitized CI (LLVM 18)

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_SANITIZE=ON -DCMAKE_CXX_COMPILER=clang++ .. -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_SANITIZE_UNDEFINED=ON  -DCMAKE_CXX_COMPILER=clang++ .. -DSIMDUTF_FAST_TESTS=On &&
            cmake --build . --parallel $(nproc) &&
            ctest --output-on-failure --parallel $(nproc)
