name: CI
on:
push:
branches: [master]
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-14, windows-2022]
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: cargo fmt
run: cargo fmt --all
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --fix --all-features --allow-dirty
- name: cargo clippy check
run: cargo clippy --all-targets --all-features -- -D warnings
- name: cargo build
run: cargo build --verbose
- name: cargo test
run: cargo test --verbose
- name: Verify Cargo.lock is up to date
run: cargo update --locked --workspace