-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (35 loc) · 1.38 KB
/
sanitizers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Sanitizers
on: [ pull_request, push ]
env:
BUILD_TYPE: RelWithDebInfo
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: ASan
cmake-flags: -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer"
- name: UBSan
cmake-flags: -DCMAKE_CXX_FLAGS="-fsanitize=undefined -fno-omit-frame-pointer"
- name: TSan
cmake-flags: -DCMAKE_CXX_FLAGS="-fsanitize=thread -fno-omit-frame-pointer"
name: ${{ matrix.name }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18 all
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 200
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -S . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{matrix.cmake-flags}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel $(nproc)
- name: Test
run: ctest --test-dir ${{github.workspace}}/build -C ${{env.BUILD_TYPE}} --output-on-failure