name: Test
on: [push, pull_request]
permissions:
actions: write
contents: read
env:
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
jobs:
msrv:
name: Minimum supported Rust version
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.85.1
id: rust-toolchain
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-
- uses: mozilla-actions/sccache-action@v0.0.9
- run: cargo check --workspace --all-targets --no-default-features
- run: cargo check --workspace --all-targets --all-features
- run: cargo test --workspace --all-features --lib --bins --examples --tests -- --skip expand
- run: cargo test --workspace --all-features --benches
- run: cargo test --workspace --doc --all-features
check:
name: Check
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
components: clippy, rustfmt
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Check
run: cargo check --workspace --all-targets --all-features
- name: Test
run: cargo test --workspace --all-targets --all-features
- name: Doctest
run: cargo test --workspace --doc --all-features
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
- name: Rustfmt
run: cargo fmt --all -- --check
miri:
name: Miri
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@miri
id: rust-toolchain
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-
- run: cargo miri setup
- run: cargo miri test --no-default-features
- run: cargo miri test --all-features
coverage:
name: Coverage
runs-on: ubuntu-24.04-arm
env:
RUSTFLAGS: "-C instrument-coverage"
RUSTDOCFLAGS: "-C instrument-coverage"
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
id: rust-toolchain
with:
components: llvm-tools-preview
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-
- uses: mozilla-actions/sccache-action@v0.0.9
- run: cargo build --workspace --all-targets --all-features
- run: cargo test --workspace --all-targets --all-features
env:
LLVM_PROFILE_FILE: "narrow-%p-%m.profraw"
- name: Install grcov
run: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-aarch64-unknown-linux-gnu.tar.bz2 | tar jxf -
- name: grcov
run: ./grcov --branch --binary-path ./target/debug/ --source-dir . --output-type lcov --output-path lcov.info .
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}