add README #3
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
name: Rust | |
on: | |
push: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: -Dwarnings | |
RUST_BACKTRACE: 1 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Update Rust | |
run: rustup update stable | |
- name: Install Miri | |
run: | | |
rustup toolchain install nightly --component miri | |
cargo +nightly miri setup | |
- name: Instal cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Clippy each feature set | |
run: | | |
cargo clippy --all-targets | |
cargo clippy --all-targets --features "std" | |
- name: Build | |
run: cargo build --all-targets --all-features | |
- name: Run tests with MIRI | |
run: cargo +nightly miri test --all-features | |
- name: Run two-thread tests with Loom and coverage | |
run: | | |
cargo llvm-cov clean | |
cargo llvm-cov --no-report --all-features | |
env: | |
RUSTFLAGS: -Dwarnings --cfg loom | |
- name: Run three-thread tests with Loom and coverage | |
run: | | |
cargo llvm-cov --no-report --all-features -- --ignored | |
cargo llvm-cov report --codecov --output-path codecov.json | |
env: | |
RUSTFLAGS: -Dwarnings --cfg loom | |
LOOM_MAX_PREEMPTIONS: 3 | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: codecov.json | |
fail_ci_if_error: true | |
- name: Validate documentation | |
run: cargo doc --no-deps | |
- name: Check formatting | |
run: cargo fmt --all -- --check | |
env: | |
RUSTDOCFLAGS: -Dwarnings |