name: Rust
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
rustup update
rustup component add clippy
rustup toolchain install nightly --component rustfmt
- name: Load cache
uses: Swatinem/rust-cache@v2
- name: Style
run: cargo +nightly fmt -- --check
- name: Install cargo-lints
run: cargo install --git https://github.com/FlixCoder/cargo-lints
- name: Check and Clippy
run: cargo lints clippy --all-targets --workspace -- -D warnings
- name: Check and Clippy for all features
run: cargo lints clippy --all-targets --workspace --all-features -- -D warnings
- name: Run tests
run: cargo test --workspace --no-run && cargo test --workspace -- --nocapture
- name: Run tests for all features
run: cargo test --workspace --all-features --no-run && cargo test --workspace --all-features -- --nocapture