Introduce a "cargo fmt" github action gate

This should prevent non-fmt code from hitting the master branch.
This commit is contained in:
Chris Glass 2026-02-28 22:39:27 +01:00
parent ffe73cd0da
commit 8d7b92b1b1
2 changed files with 39 additions and 8 deletions

26
.github/workflows/rust-checks.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Rust Checks
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check