forked from bai/curriculum-project-hub
ci: add Rust checker workflow (fmt + clippy -D warnings + test)
Mirrors spec-check's framing: an internal health gate on the implementation (build/test/lint), not a spec→impl conformance gate (alignment is by review). Installs fonts-noto-cjk ahead of the typst-compiling crates (WU-4+), since the engineering files are CJK-heavy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
|||||||
|
name: checker check
|
||||||
|
|
||||||
|
# Builds and lints the Rust implementation crates under crates/ (the rule-based
|
||||||
|
# checker that "stands in Lean's position" at product runtime).
|
||||||
|
#
|
||||||
|
# Like spec-check, this is an INTERNAL gate on the implementation's own health
|
||||||
|
# (does it build, pass its tests, satisfy clippy + rustfmt?). It is NOT a
|
||||||
|
# spec-to-implementation conformance gate — implementations align to the Lean
|
||||||
|
# contract by human review, not by CI. See the repo README.
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checker-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install Rust toolchain (stable + clippy + rustfmt)
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
components: clippy, rustfmt
|
||||||
|
|
||||||
|
- name: Cache cargo registry + build
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
target
|
||||||
|
key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
cargo-${{ runner.os }}-
|
||||||
|
|
||||||
|
# Fonts for typst compilation (WU-4 onward): the engineering files are
|
||||||
|
# CJK-heavy, so the compile-check / build tests need a CJK font present.
|
||||||
|
# Harmless before those crates exist.
|
||||||
|
- name: Install CJK fonts
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y fonts-noto-cjk
|
||||||
|
|
||||||
|
- name: Format check
|
||||||
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
|
- name: Clippy (deny warnings)
|
||||||
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: cargo test --all-features --workspace
|
||||||
Reference in New Issue
Block a user