name: Memory Safety Checks (ASAN)
on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
jobs:
asan-library-tests:
name: ASAN Memory Safety Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v6
- name: Install Rust nightly toolchain with ASAN support
uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-asan-${{ hashFiles('**/Cargo.lock') }}
- name: Run ASAN on library tests
run: |
export RUSTFLAGS="-Z sanitizer=address"
export LSAN_OPTIONS="suppressions=${{ github.workspace }}/.cargo/asan_suppressions.txt"
# Use -Zbuild-std to rebuild std with ASAN and properly handle proc-macros
# Proc-macros run on host at compile time, so they need special handling
cargo test --lib --package mrrc -q -Zbuild-std --target x86_64-unknown-linux-gnu
- name: Report results
if: always()
run: echo "ASAN tests completed. Check output above for any issues."