Skip to content

add workflow for sanitizer checks #5

add workflow for sanitizer checks

add workflow for sanitizer checks #5

Workflow file for this run

name: Tests with Sanitizers
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
run-tests-with-sanitizers:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer_flags: ["-fsanitize=address -fno-omit-frame-pointer",
"-fsanitize=undefined -fno-sanitize-recover=undefined",
"-fsanitize=thread",
"-fsanitize=memory"]
build_type: [Debug]
c_compiler : [clang]
cpp_compiler: [clang++]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y libboost-all-dev
- name: Configure CMake
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS==${{ matrix.sanitizer_flags }} \
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
-DBUILD_TESTS=ON
- name: Build
run: cmake --build build -- -j$(nproc)
- name: Run tests
run: |
cd build && ctest --output-on-failure
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: sanitizer-logs
path: build/**/*.log