ci: fix address sanitizer step

This commit is contained in:
ObserverOfTime 2024-05-04 11:34:03 +03:00 committed by Amaan Qureshi
parent 6bfdae00f2
commit 572cdaa7c0
3 changed files with 10 additions and 13 deletions

View file

@ -2,7 +2,7 @@ name: Sanitize
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
RUSTFLAGS: -D warnings
on:
workflow_call:
@ -34,17 +34,13 @@ jobs:
- name: Run main tests with undefined behaviour sanitizer (UBSAN)
env:
UBSAN_OPTIONS: halt_on_error=1
CFLAGS: -fsanitize=undefined
RUSTFLAGS: ${{ env.RUSTFLAGS }} -lubsan
run: cargo test -- --test-threads 1
- name: Run main tests with address sanitizer (ASAN)
env:
ASAN_OPTIONS: halt_on_error=1
ASAN_OPTIONS: verify_asan_link_order=0
CFLAGS: -fsanitize=address
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Zsanitizer=address --cfg=sanitizing
run: |
rustup install nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
cargo +nightly test -Z build-std --target x86_64-unknown-linux-gnu -- --test-threads 1
RUSTFLAGS: ${{ env.RUSTFLAGS }} -lasan --cfg sanitizing
run: cargo test -- --test-threads 1