name: "Test"
on:
push:
branches: ["main"]
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
test_on_stable:
name: Rust test on stable
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- run: rustc --version
- name: Run cargo check
run: cargo check --release --workspace --all-features
- name: Run cargo clippy
run: |
cargo clippy --version
cargo clippy --all-targets --all-features -- -D warnings --no-deps
- name: Install cargo-sort
uses: taiki-e/install-action@v2
with:
tool: cargo-sort
if: matrix.os == 'ubuntu'
- name: Run cargo sort
run: cargo sort --check --workspace --grouped
if: matrix.os == 'ubuntu'
- name: Run cargo fmt
run: |
cargo fmt --version
cargo fmt --all --check --message-format human
- name: Run tests with all features
run: cargo test --all-features
- name: Run tests for documentation
run: cargo test --doc
test_on_nightly:
name: Rust test on nightly
needs: test_on_stable
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- run: rustc --version
- name: Install cargo-udeps
uses: taiki-e/install-action@v2
with:
tool: cargo-udeps
- name: Run cargo +nightly udeps
run: cargo +nightly udeps --release --workspace --all-targets --all-features