Skip to content

Commit acd55bf

Browse files
committed
ci: add sanitiser builds to detect memory errors
- Add AddressSanitizer for memory error detection - Add ThreadSanitizer for race condition detection - Add UndefinedBehaviorSanitizer for undefined behaviour - Run on self-hosted runner with clang Signed-off-by: NotKeira <github.rxs06@accounts.keira.boo>
1 parent 0b3e1bd commit acd55bf

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,30 @@ jobs:
8484
- name: Run Benchmarks (Release only)
8585
if: matrix.build_type == 'Release'
8686
working-directory: build
87-
run: ./alloc_benchmarks --benchmark_min_time=0.1
87+
run: ./alloc_benchmarks --benchmark_min_time=0.1
88+
sanitisers:
89+
runs-on: self-hosted
90+
strategy:
91+
matrix:
92+
sanitiser: [ address, thread, undefined ]
93+
steps:
94+
- uses: actions/checkout@v4
95+
96+
- name: Configure with Sanitiser
97+
env:
98+
CC: clang
99+
CXX: clang++
100+
run: |
101+
cmake -B build -DCMAKE_BUILD_TYPE=Debug \
102+
-DCMAKE_CXX_FLAGS="-fsanitize=${{ matrix.sanitiser }} -fno-omit-frame-pointer -g" \
103+
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=${{ matrix.sanitiser }}"
104+
105+
- name: Build
106+
run: cmake --build build
107+
108+
- name: Run Tests
109+
working-directory: build
110+
env:
111+
ASAN_OPTIONS: detect_leaks=1
112+
TSAN_OPTIONS: second_deadlock_stack=1
113+
run: ctest --output-on-failure

0 commit comments

Comments
 (0)