Add (only) LSAN workflow

This commit is contained in:
Jon Gjengset 2022-09-17 12:34:43 -07:00
parent f67cad0f91
commit bf66d94f15

32
github/workflows/lsan.yml Normal file
View file

@ -0,0 +1,32 @@
on:
push:
branches: [main]
pull_request:
name: Leak sanitizer
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions/checkout@v2
- run: |
# to get the symbolizer for debug symbol resolution
sudo apt install llvm
# 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: Enable debug symbols
- name: cargo test -Zsanitizer=leak
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --target x86_64-unknown-linux-gnu
env:
RUSTFLAGS: "-Z sanitizer=leak"
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"