From c15196396706b2b4be3c24b6008ee028f9b704d9 Mon Sep 17 00:00:00 2001 From: sjfhsjfh Date: Mon, 22 Jun 2026 01:28:12 +0800 Subject: [PATCH] ci: add Rust checker workflow (fmt + clippy -D warnings + test) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .gitea/workflows/checker-check.yml | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .gitea/workflows/checker-check.yml diff --git a/.gitea/workflows/checker-check.yml b/.gitea/workflows/checker-check.yml new file mode 100644 index 0000000..a6ce325 --- /dev/null +++ b/.gitea/workflows/checker-check.yml @@ -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