name: Checks
on:
push:
branches: [main]
merge_group:
types: [checks_requested]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - run: rustup show active-toolchain
- run: rustc --version
- run: cargo --version
- run: rustup component add clippy rustfmt
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - run: cargo fmt --all -- --check
- run: cargo clippy --workspace --all-targets --all-features
doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - run: rustup show active-toolchain
- run: rustc --version
- run: cargo --version
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - run: cargo test --workspace --all-features --doc
- run: cargo doc --workspace --all-features --document-private-items --no-deps
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
name: test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - run: rustup show active-toolchain
- run: rustc --version
- run: cargo --version
- run: rustup component add llvm-tools
- uses: taiki-e/install-action@5ebac0d9522d786674368e47e92963ba13f2c376 with:
tool: cargo-llvm-cov,nextest
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - run: cargo llvm-cov nextest --workspace --all-features --lib --bins --examples --tests --lcov --output-path lcov.info
- run: cargo test --doc --workspace --all-features
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/nextest/default/junit.xml
report_type: test_results
disable_search: true
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
disable_search: true
msrv-minimal:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
name: msrv test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 - run: echo "TARGET_RUST_VERSION=$(grep rust-version Cargo.toml | grep MSRV | cut -d'"' -f2)" >> $GITHUB_ENV
- run: rustup toolchain install ${{ env.TARGET_RUST_VERSION }} --profile minimal --no-self-update
- run: rustup toolchain install nightly --profile minimal --no-self-update
- run: rustup default ${{ env.TARGET_RUST_VERSION }}
- run: rustup show active-toolchain
- run: rustc --version
- run: cargo --version
- uses: taiki-e/install-action@5ebac0d9522d786674368e47e92963ba13f2c376 with:
tool: nextest
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 - run: cargo +nightly update -Z direct-minimal-versions
- run: cargo nextest run --workspace --all-features --lib --bins --examples --tests --release