-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf2dc81
commit b138c10
Showing
2 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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 | ||
- wasm32-wasip1 | ||
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 | ||
- sanitizer: leak | ||
target: wasm32-wasip1 | ||
# 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 }} | ||
continue-on-error: true | ||
|
||
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 }} |