1
Fork 0
mirror of https://github.com/RGBCube/cstree synced 2025-07-28 09:37:44 +00:00

Add CI and address soundness issues brought up by miri (#10)

This commit is contained in:
DQ 2021-01-30 20:21:30 +01:00 committed by GitHub
parent ac68150dbb
commit 621718e9b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 303 additions and 189 deletions

130
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,130 @@
name: CI
on:
push:
branches:
- master
pull_request:
# Daily
schedule:
- cron: "0 4 * * *"
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
env:
RUST_LOG: info
RUST_BACKTRACE: 1
jobs:
test:
name: Test ${{ matrix.rust }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, nightly]
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- run: cargo test --verbose --all-features
- run: cargo test --release --verbose --all-features
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: check
clippy:
name: Clippy
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: clippy
- run: cargo clippy --all-targets --all-features --verbose -- -D warnings
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: rustfmt
- run: cargo fmt -p cstree -- --check
rustdoc:
name: Check doc links
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- run: cargo doc --all-features --document-private-items --no-deps
miri-test:
name: Miri ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
components: miri
- run: cargo miri test --verbose --all-features -- -Zmiri-disable-isolation
sanitizers:
name: ${{ matrix.sanitizer }} sanitizer
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitizer: [address, memory, thread, leak]
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
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 --verbose --target=x86_64-unknown-linux-gnu --all-features