Add weekly sanitizer run to CI #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sanitizers | |
on: | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/sanitizers.yml' | |
schedule: | |
- cron: '12 07 * * 2' # weekly on Tuesday | |
jobs: | |
sanitizers: | |
strategy: | |
matrix: | |
sanitizer: | |
- name: address | |
- name: leak | |
- name: memory | |
extra_flags: -Zsanitizer-memory-track-origins | |
- name: safestack | |
- name: thread | |
target: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: windows-latest | |
target: x86_64-pc-windows-gnu | |
- os: ubuntu-latest | |
target: wasm32-wasip1 | |
exclude: | |
# AddressSanitizer is not supported on Windows | |
- sanitizer: | |
name: address | |
target: | |
os: windows-latest | |
target: x86_64-pc-windows-gnu | |
# LeakSanitizer is not supported on MacOS, Windows | |
- sanitizer: | |
name: leak | |
target: | |
os: macos-latest | |
target: x86_64-apple-darwin | |
- sanitizer: | |
name: leak | |
target: | |
os: windows-latest | |
target: x86_64-pc-windows-gnu | |
# MemorySanitizer is not supported on MacOS, Windows | |
- sanitizer: | |
name: memory | |
extra_flags: -Zsanitizer-memory-track-origins | |
target: | |
os: macos-latest | |
target: x86_64-apple-darwin | |
- sanitizer: | |
name: memory | |
extra_flags: -Zsanitizer-memory-track-origins | |
target: | |
os: windows-latest | |
target: x86_64-pc-windows-gnu | |
# ThreadSanitizer is not supported on Windows | |
- sanitizer: | |
name: thread | |
target: | |
os: windows-latest | |
target: x86_64-pc-windows-gnu | |
runs-on: ${{ matrix.target.os }} | |
continue-on-error: true | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: -D warnings -Zsanitizer=${{ matrix.sanitizer.name }} ${{ matrix.sanitizer.extra_flags }} | |
RUSTDOCFLAGS: -Zsanitizer=${{ matrix.sanitizer.name }} ${{ matrix.sanitizer.extra_flags }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
run: | | |
rustup toolchain install nightly --component rust-src --allow-downgrade | |
rustup override set nightly | |
rustup target add --toolchain nightly ${{ matrix.target.target }} | |
- name: Build | |
run: cargo build -Zbuild-std | |
- name: Run tests | |
run: cargo test --verbose --all-features --no-fail-fast |