-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (29 loc) · 1.11 KB
/
rust_sanitizers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
on: push
name: Run Sanitizers
jobs:
sanitizers:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
sanitizer: [ address ]
steps:
- name: Install dependencies
run: sudo apt -y update && sudo apt -y install flex bison
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: Install Rust nightly
run: |
rustup toolchain install nightly --profile minimal --component rust-src
rustup override set nightly
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.sanitizer }}-sanitizer
- run: |
echo "TARGET=$(rustc -vV | awk '/^host: / { print $2 }')" >>${GITHUB_ENV}
- name: Run ${{ matrix.sanitizer }} sanitizer for ${{ env.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 ${{ env.TARGET }}