mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-05 23:54:50 +08:00
Keep Rust PRs green with a minimal CI gate
Add a focused GitHub Actions workflow for pull requests into main plus manual dispatch. The workflow checks workspace formatting and runs the rusty-claude-cli crate tests so we get a real signal on the active Rust surface without widening scope into a full matrix. Because the workspace was not rustfmt-clean, include the formatting-only updates needed for the new fmt gate to pass immediately. Constraint: Keep scope to a fast, low-noise Rust PR gate Constraint: CI should validate formatting and rusty-claude-cli without expanding to full workspace coverage Rejected: Full workspace test or clippy matrix | too broad for the one-hour shipping window Rejected: Add fmt CI without reformatting the workspace | the new gate would fail on arrival Confidence: high Scope-risk: narrow Directive: Keep this workflow focused unless release requirements justify broader coverage Tested: cargo fmt --all -- --check Tested: cargo test -p rusty-claude-cli Tested: YAML parse of .github/workflows/rust-ci.yml via python3 + PyYAML Not-tested: End-to-end execution on GitHub-hosted runners
This commit is contained in:
48
.github/workflows/rust-ci.yml
vendored
Normal file
48
.github/workflows/rust-ci.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Rust CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .github/workflows/rust-ci.yml
|
||||
- rust/**
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: rust-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: rust
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
name: cargo fmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: rust -> target
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
test-rusty-claude-cli:
|
||||
name: cargo test -p rusty-claude-cli
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: rust -> target
|
||||
- name: Run crate tests
|
||||
run: cargo test -p rusty-claude-cli
|
||||
Reference in New Issue
Block a user