Skip to content

Commit 3893905

Browse files
committed
ci: run with sanitizers
1 parent c732bd2 commit 3893905

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/check.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
uses: ./neqo/.github/actions/rust
6060
with:
6161
version: ${{ matrix.rust-toolchain }}
62-
components: rustfmt, clippy, llvm-tools-preview
62+
components: rustfmt, clippy, llvm-tools-preview${{ contains(matrix.rust-toolchain, 'nightly') && ', rust-src' || '' }}
6363
tools: cargo-llvm-cov, cargo-nextest, cargo-hack, cargo-machete
6464
token: ${{ secrets.GITHUB_TOKEN }}
6565

@@ -74,6 +74,19 @@ jobs:
7474
RUST_LOG=trace cargo +${{ matrix.rust-toolchain }} llvm-cov nextest $BUILD_TYPE --no-fail-fast --lcov --output-path lcov.info
7575
cargo +${{ matrix.rust-toolchain }} bench --no-run
7676
77+
- name: Run tests with sanitizers
78+
if: matrix.os == 'ubuntu-latest' && matrix.rust-toolchain == 'nightly'
79+
env:
80+
# Asan's leak detection occasionally complains
81+
# about some small leaks if backtraces are captured,
82+
# so ensure they're not
83+
RUST_BACKTRACE: 0
84+
run: |
85+
for sanitizer in address thread leak memory; do
86+
echo "Running tests with $sanitizer sanitizer..."
87+
RUSTFLAGS="-Z sanitizer=$sanitizer" cargo +nightly test -Z build-std --target x86_64-unknown-linux-gnu
88+
done
89+
7790
- name: Check formatting
7891
run: |
7992
if [ "${{ matrix.rust-toolchain }}" != "nightly" ]; then

0 commit comments

Comments
 (0)