name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test (${{ matrix.os }} / ${{ matrix.rust }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, beta]
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal
rustup default ${{ matrix.rust }}
- name: Build (all features)
run: cargo build --all-features --verbose
- name: Build (no default features)
run: cargo build --no-default-features --verbose
- name: Test (all features)
run: cargo test --all-features --verbose
msrv:
name: MSRV (1.85)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup toolchain install 1.85 --profile minimal
rustup default 1.85
- name: Build (all features)
run: cargo build --all-features --verbose
- name: Test (all features)
run: cargo test --all-features --verbose
lint:
name: Rustfmt & Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup toolchain install stable --profile minimal --component rustfmt --component clippy
rustup default stable
- name: Check formatting
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-features