Skip to content

Commit af22c0b

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

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/check.yml

Lines changed: 18 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, ${{ 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,23 @@ 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.os == 'macos-14') && matrix.rust-toolchain == 'nightly'
79+
run: |
80+
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
81+
TARGET="x86_64-unknown-linux-gnu"
82+
SANITIZERS="address thread leak memory"
83+
elif [ "${{ matrix.os }}" = "macos-14" ]; then
84+
TARGET="aarch64-apple-darwin"
85+
# no leak sanitizer support yet
86+
SANITIZERS="address thread memory"
87+
fi
88+
89+
for sanitizer in $SANITIZERS; do
90+
echo "Running tests with $sanitizer sanitizer..."
91+
RUSTFLAGS="-Z sanitizer=$sanitizer" cargo +nightly test -Z build-std --target $TARGET
92+
done
93+
7794
- name: Check formatting
7895
run: |
7996
if [ "${{ matrix.rust-toolchain }}" != "nightly" ]; then

0 commit comments

Comments
 (0)