name: Rust Format
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
format:
name: Format
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Run clippy
run: |
cargo clippy \
--all-targets \
-- -D warnings \
-W clippy::pedantic \
-W clippy::nursery \
-W clippy::style \
-W clippy::complexity \
-W clippy::perf \
-W clippy::suspicious \
-W clippy::correctness
- name: Check formatting
run: cargo fmt --all -- --check