Skip to content

Commit 5219ac6

Browse files
authored
Add LSan to CI
1 parent 22962c3 commit 5219ac6

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@ jobs:
3232
- uses: actions/checkout@v2
3333
- name: Prepare
3434
run: bash scripts/install_dependency.sh
35-
- name: Configure CMake
36-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
35+
- name: Configure CMake with LSan
36+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
37+
-DCMAKE_C_FLAGS="-fsanitize=address,leak" \
38+
-DCMAKE_CXX_FLAGS="-fsanitize=address,leak"
3739
- name: Build
3840
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
39-
- name: Test
41+
- name: Test with LSan
4042
working-directory: ${{github.workspace}}/build
41-
run: ctest -C ${{env.BUILD_TYPE}}
43+
run: |
44+
# Set ASan/LSan options for runtime detection
45+
export ASAN_OPTIONS="detect_leaks=1:halt_on_error=1:verbosity=1"
46+
ctest -C ${{env.BUILD_TYPE}}
4247
4348
selfhosted:
4449
runs-on: self-hosted

0 commit comments

Comments
 (0)