Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with address, undefined, and thread sanitizer in CI #4

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ jobs:
strategy:
matrix:
buildtype: [debug, release]
sanitizer: [none, address, leak, undefined, thread]
exclude:
# False positive warnings in release builds: https://godbolt.org/z/vT3nqGxzW
- buildtype: release
sanitizer: address
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Expand All @@ -21,13 +26,14 @@ jobs:
- name: Set up ccache
uses: hendrikmuhs/[email protected]
with:
key: ccache-linux-${{ matrix.buildtype }}
key: ccache-linux-${{ matrix.buildtype }}-${{ matrix.sanitizer }}
- name: Setup compiler and build tools
run: sudo apt install --no-install-recommends --yes g++-12 meson ninja-build
- name: Configure
run: |
CXX="ccache g++-12" meson setup \
--buildtype ${{ matrix.buildtype }} \
-Db_sanitize=${{ matrix.sanitizer }} \
--warnlevel 3 \
--werror \
build .
Expand All @@ -36,4 +42,7 @@ jobs:
- name: Setup Test
run: cd test/setup && ./setup
- name: Test
run: cd build && ./unit
run: |
export ASAN_OPTIONS=fast_unwind_on_malloc=0:strict_string_checks=1:detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
export UBSAN_OPTIONS=print_stacktrace=1
cd build && ./unit