-
Notifications
You must be signed in to change notification settings - Fork 94
57 lines (52 loc) · 1.61 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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:
- address
- leak
- memory
- safestack
- thread
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- sanitizer: memory
extra_flags: -Zsanitizer-memory-track-origins
exclude:
# LeakSanitizer is not supported on MacOS
- sanitizer: leak
target: x86_64-apple-darwin
# MemorySanitizer is not supported on MacOS
- sanitizer: memory
target: x86_64-apple-darwin
# Safestack is not supported on MacOS
- sanitizer: safestack
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}
components: rust-src
- name: Run tests with sanitizer
run: cargo test -Zbuild-std --verbose --all-features --no-fail-fast --target ${{ matrix.target }}
env:
RUSTFLAGS: -D warnings -Zsanitizer=${{ matrix.sanitizer }} ${{ matrix.extra_flags }}
RUSTDOCFLAGS: -Zsanitizer=${{ matrix.sanitizer }} ${{ matrix.extra_flags }}