name: Build
on:
push:
branches: [main, master]
paths:
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/ci.yml"
- "!**/*.md"
pull_request:
branches: [main, master]
paths:
- "src/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/ci.yml"
- "!**/*.md"
jobs:
test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.95
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: "ci-${{ matrix.os }}"
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test --verbose
msrv:
name: MSRV Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust (MSRV)
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.95
- uses: Swatinem/rust-cache@v2
with:
shared-key: "ci-ubuntu-latest"
- name: Check MSRV
run: cargo check --all-targets