Skip to content

Commit

Permalink
build: trying mira and sanitizer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstonskj committed Oct 14, 2024
1 parent 76f9040 commit 064ec5c
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
RUST_LOG: info
RUST_BACKTRACE: 1
RUST_VERBOSE: --verbose
RUST_DOCFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings

jobs:
publish:
Expand Down Expand Up @@ -186,7 +186,6 @@ jobs:


mira:
if: false
name: Mira tests
needs: test
strategy:
Expand All @@ -208,6 +207,39 @@ jobs:
run: cargo miri test ${{ env.RUST_VERBOSE }} ${{ matrix.test-features }}


sanitizer-test:
name: Test with -Zsanitizer=${{ matrix.sanitizer }}
needs: test
strategy:
fail-fast: false
matrix:
sanitizer: [address, memory, thread, leak]
test-features: ["", "--all-features", "--no-default-features"]
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust Toolchain
uses: hecrj/setup-rust-action@v2
with:
rust-version: nightly
components: rust-src

- name: Test with sanitizer
env:
RUSTFLAGS: -Zsanitizer=${{ matrix.sanitizer }}
RUSTDOCFLAGS: -Zsanitizer=${{ matrix.sanitizer }}
# only needed by asan
ASAN_OPTIONS: detect_stack_use_after_return=1
# Asan's leak detection occasionally complains
# about some small leaks if backtraces are captured,
# so ensure they're not
RUST_BACKTRACE: 0
run: cargo test -Zbuild-std ${{ env.RUST_VERBOSE }} --target=x86_64-unknown-linux-gnu ${{ matrix.test-features }}


docs:
name: Document generation
needs: [rustfmt, clippy]
Expand All @@ -225,7 +257,7 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Generate documentation
run: cargo doc ${{ env.RUST_VERBOSE }} --workspace --all-features --no-deps ${{ env.RUST_DOCFLAGS }}
run: cargo doc ${{ env.RUST_VERBOSE }} --workspace --all-features --no-deps


rustfmt:
Expand Down

0 comments on commit 064ec5c

Please sign in to comment.