Skip to content

Fix GitHub Actions with hints from zizmor #327

Fix GitHub Actions with hints from zizmor

Fix GitHub Actions with hints from zizmor #327

name: Sanitizers
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
sanitizers:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
sanitizer: [ address ]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
steps:
- name: Install dependencies
run: sudo apt -y update && sudo apt -y install flex bison
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: sensorfu/setup-rust-action@v1
with:
toolchain: nightly
components: rust-src
- name: Run ${{ matrix.sanitizer }} sanitizer for ${{ matrix.target }}
env:
RUSTFLAGS: -Z sanitizer=${{ matrix.sanitizer }}
RUSTDOCFLAGS: -Z sanitizer=${{ matrix.sanitizer }}
ASAN_OPTIONS: verbose=1:atexit=1:detect_stack_use_after_return=1:strict_string_checks=1
run: cargo test -Zbuild-std --target ${{ matrix.target }}