CI: clippy over every target, against the lockfile

79b9faf · Gabe Morell · 2026-11-05 00:12

3 files +37 -0
Message
{commit_body(@commit)}

Files changed

added .forgejo/workflows/clippy.yml
+37 −0
@@ -0,0 +1,37 @@
1 +name: clippy
2 +# Lints gate master: every warning clippy or rustc raises fails the run.
3 +# The same command every Rust repository on the forge runs, over every
4 +# target, against the committed Cargo.lock (the crate in code/).
5 +on:
6 + push:
7 + branches: [master]
8 + pull_request:
9 + workflow_dispatch:
10 +
11 +permissions:
12 + contents: read
13 +
14 +# A newer push supersedes this run: on a branch or PR the run in
15 +# progress is cancelled; on master it finishes, and only a run still
16 +# waiting is replaced.
17 +concurrency:
18 + group: ${{ github.workflow }}-${{ github.ref }}
19 + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
20 +
21 +jobs:
22 + clippy:
23 + runs-on: self-hosted
24 + steps:
25 + - uses: actions/checkout@v4
26 +
27 + # The toolchain dependency-updates.yml resolves code/Cargo.lock with
28 + # (1.92.0). Installed directly, since this runner sets ImageOS to
29 + # "selfhosted" over anything a workflow says.
30 + - name: Rust
31 + run: |
32 + curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.92.0 -c clippy
33 + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
34 +
35 + - name: Run clippy
36 + working-directory: code
37 + run: cargo clippy --workspace --all-targets --locked -- -D warnings

Parents: d14c855