Make CI and agents run rustfmt
This commit is contained in:
parent
b840a7d694
commit
c8675be472
2 changed files with 44 additions and 1 deletions
41
.github/workflows/ci.yml
vendored
41
.github/workflows/ci.yml
vendored
|
|
@ -120,6 +120,47 @@ jobs:
|
|||
. "$HOME/.cargo/env"
|
||||
cargo clippy --all-targets -- -D warnings
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:25.10
|
||||
steps:
|
||||
- name: Install git
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y git curl
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install build dependencies
|
||||
run: ./scripts/shepherd deps install build
|
||||
|
||||
- name: Add rustfmt component
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
rustup component add rustfmt
|
||||
|
||||
- name: Add Rust to PATH
|
||||
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Cache cargo registry and build
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-
|
||||
|
||||
- name: Check formatting
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cargo fmt --all
|
||||
git diff --exit-code
|
||||
|
||||
shellcheck:
|
||||
name: ShellCheck
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ Agents: please use the existing documentation for setup.
|
|||
|
||||
<CONTRIBUTING.md> describes environment setup and build, test, and lint, including helper scripts and exact commands.
|
||||
|
||||
Please ensure that your changes build and pass tests and lint. If you changed the example configuration at <config.example.toml>, make sure that it passes config validation.
|
||||
Please ensure that your changes build and pass tests and lint, and run `cargo fmt --all` to match your changes to the rest of the code.
|
||||
|
||||
If you changed the example configuration at <config.example.toml>, make sure that it passes config validation.
|
||||
|
||||
Each of the Rust crates in <crates> contains a README.md that describes each at a high level.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue