diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 986bf1f..ed0a007 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,16 @@ env: # separate ci-compat.yml workflow so their failures don't mark this run red. # ───────────────────────────────────────────────────────────────────────────── jobs: + fmt: + name: Format check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - run: cargo fmt --check + build: name: Build (${{ matrix.os }}) runs-on: ${{ matrix.os }} diff --git a/testing/ci-local.sh b/testing/ci-local.sh index c343e66..f6784da 100755 --- a/testing/ci-local.sh +++ b/testing/ci-local.sh @@ -153,6 +153,14 @@ run_build() { return 1 fi + info "cargo fmt --check" + if cargo fmt --check 2>&1; then + record "fmt" 0 + else + record "fmt" 1 + return 1 + fi + info "cargo clippy --all -- -D warnings" if cargo clippy --all -- -D warnings 2>&1; then record "clippy" 0