Skip to content

Commit ad6991e

Browse files
kkaeferclaude
andcommitted
Add AddressSanitizer and UndefinedBehaviorSanitizer testing
- Add new Sanitizers job, testing with combined ASan+UBSan - Use clang++ compiler for better sanitizer support - Configure strict sanitizer options to abort on any detected issues - Enables detection of memory leaks, buffer overflows, and undefined behavior 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 45c984a commit ad6991e

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,57 @@ jobs:
152152
name: coverage-report
153153
path: coverage/
154154

155+
Sanitizers:
156+
runs-on: ubuntu-latest
157+
158+
container:
159+
image: ubuntu:24.04
160+
161+
env:
162+
CXX: clang++
163+
DEBIAN_FRONTEND: noninteractive
164+
165+
permissions:
166+
contents: read
167+
id-token: write
168+
169+
steps:
170+
- name: Update Git
171+
run: |
172+
apt-get update
173+
apt-get install -y git
174+
git --version
175+
176+
- name: Checkout repository
177+
uses: actions/checkout@v5
178+
with:
179+
submodules: true
180+
181+
- name: Install dependencies
182+
run: |
183+
apt-get install -y cmake ninja-build clang xorg-dev
184+
clang++ --version
185+
cmake --version
186+
ninja --version
187+
188+
- name: Create build directory
189+
run: mkdir -p build
190+
shell: bash
191+
192+
- name: Configure CMake with sanitizers
193+
working-directory: build
194+
run: cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g"
195+
196+
- name: Build all targets
197+
working-directory: build
198+
run: ninja
199+
200+
- name: Run tests with sanitizers
201+
run: build/tests
202+
env:
203+
ASAN_OPTIONS: detect_leaks=1:abort_on_error=1
204+
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1
205+
155206
MacOS:
156207
strategy:
157208
fail-fast: false

0 commit comments

Comments
 (0)