Skip to content

Commit

Permalink
Test w/ sanitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
d-e-s-o committed Jan 2, 2024
1 parent 61b45c2 commit 6361c9e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -62,6 +62,33 @@ jobs:
uses: codecov/codecov-action@v3
with:
files: lcov.info
test-sanitizers:
name: Test with ${{ matrix.sanitizer }} sanitizer
strategy:
fail-fast: false
matrix:
sanitizer: [address, leak]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Enable debug symbols
run: |
# to get the symbolizer for debug symbol resolution
sudo apt-get install -y llvm-14
# to fix buggy leak analyzer:
# https://github.com/japaric/rust-san#unrealiable-leaksanitizer
sed -i '/\[features\]/i [profile.dev]' Cargo.toml
sed -i '/profile.dev/a opt-level = 1' Cargo.toml
cat Cargo.toml
- name: cargo test -Zsanitizer=${{ matrix.sanitizer }}
env:
CFLAGS: "-fsanitize=${{ matrix.sanitizer }}"
CXXFLAGS: "-fsanitize=${{ matrix.sanitizer }}"
RUSTFLAGS: "-Zsanitizer=${{ matrix.sanitizer }}"
ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0"
LSAN_OPTIONS: ""
run: cargo test --workspace --lib --tests --target x86_64-unknown-linux-gnu
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
Expand Down

0 comments on commit 6361c9e

Please sign in to comment.