Skip to content

Commit

Permalink
[cicd] simplify sanitizer pipeline set up
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisCarouge committed Oct 18, 2023
1 parent 57b36a9 commit 6f9c87a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@ jobs:
sanitizer:
- name: 'Address'
cpp_flags: '-g -O0 -fsanitize=address'
run_flags: 'ASAN_OPTIONS=verbosity=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1'
sanitizer_environment: 'ASAN_OPTIONS'
sanitizer_options: 'verbosity=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1'
- name: 'Leak'
cpp_flags: '-g -O0 -fsanitize=leak'
run_flags: 'LSAN_OPTIONS=verbosity=2'
sanitizer_environment: 'LSAN_OPTIONS'
sanitizer_options: 'verbosity=2'
- name: 'Thread'
cpp_flags: '-g -O0 -fsanitize=thread'
run_flags: 'TSAN_OPTIONS=verbosity=2'
sanitizer_environment: 'TSAN_OPTIONS'
sanitizer_options: 'verbosity=2'
- name: 'Undefined'
cpp_flags: '-g -O0 -fsanitize=undefined'
run_flags: 'UBSAN_OPTIONS=verbosity=2'
sanitizer_environment: 'UBSAN_OPTIONS'
sanitizer_options: 'verbosity=2'
name: '${{ matrix.sanitizer.name }}'
runs-on: ubuntu-latest
env:
CXXFLAGS: '${{ matrix.sanitizer.cpp_flags }}'
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
Expand All @@ -49,9 +51,11 @@ jobs:
- name: 'Configure'
env:
CXX: 'g++-13'
CXXFLAGS: '${{ matrix.sanitizer.cpp_flags }}'
CC: 'gcc-13'
${{ sanitizer_environment }}: '${{ sanitizer_options }}'
run: cmake -S . -B 'build'
- name: 'Build'
run: cmake --build 'build' --verbose --parallel 4
- name: 'Test'
run: ${{ matrix.sanitizer.run_flags }} ctest --test-dir 'build' --tests-regex 'kalman_(test|sample)' --verbose --parallel 4
run: ctest --test-dir 'build' --tests-regex 'kalman' --verbose --parallel 4

0 comments on commit 6f9c87a

Please sign in to comment.