neiam
/gitgud
Git Gud
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
1
Log in to mark this repository.
CI: clippy on the NIFs, as a gate
26334f6 · Gabe Morell · 2026-11-05 00:26
Message
{commit_body(@commit)}
Files changed
added
.forgejo/workflows/clippy.yml
+46
−0
@@ -0,0 +1,46 @@
| 1 | +name: clippy | |
| 2 | +# Clippy over the two NIF crates, as a gate: any warning fails the run. | |
| 3 | +# The CLI's own clippy runs in cli/Dockerfile, with the same command. | |
| 4 | +on: | |
| 5 | + push: | |
| 6 | + branches: [master] | |
| 7 | + pull_request: | |
| 8 | + workflow_dispatch: | |
| 9 | + | |
| 10 | +permissions: | |
| 11 | + contents: read | |
| 12 | + | |
| 13 | +# A newer push supersedes this run: on a branch or PR the run in | |
| 14 | +# progress is cancelled; on master it finishes, and only a run still | |
| 15 | +# waiting is replaced. | |
| 16 | +concurrency: | |
| 17 | + group: ${{ github.workflow }}-${{ github.ref }} | |
| 18 | + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| 19 | + | |
| 20 | +jobs: | |
| 21 | + clippy: | |
| 22 | + runs-on: self-hosted | |
| 23 | + steps: | |
| 24 | + - uses: actions/checkout@v4 | |
| 25 | + | |
| 26 | + # As the Dockerfile's builder: what the NIFs need to compile. | |
| 27 | + - name: Build dependencies | |
| 28 | + run: | | |
| 29 | + sudo apt-get update -q | |
| 30 | + sudo apt-get install -y -q --no-install-recommends \ | |
| 31 | + build-essential pkg-config libssl-dev libclang-dev | |
| 32 | + | |
| 33 | + # The same toolchain as checks.yml and the Dockerfile. | |
| 34 | + - name: Rust | |
| 35 | + run: | | |
| 36 | + curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.92.0 -c clippy | |
| 37 | + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" | |
| 38 | + | |
| 39 | + - name: Clippy | |
| 40 | + run: | | |
| 41 | + set -eu | |
| 42 | + for crate in native/gitgud_gix native/gitgud_apt; do | |
| 43 | + echo "::group::$crate" | |
| 44 | + (cd "$crate" && cargo clippy --workspace --all-targets --locked -- -D warnings) | |
| 45 | + echo "::endgroup::" | |
| 46 | + done |
modified
cli/Dockerfile
+1
−1
@@ -81,7 +81,7 @@ ARG SOURCE_DATE_EPOCH
| 81 | 81 | RUN set -eux; \ |
| 82 | 82 | mkdir -p /out; \ |
| 83 | 83 | cargo fmt --check; \ |
| 84 | − cargo clippy --all-targets --locked -- -D warnings; \ | |
| 84 | + cargo clippy --workspace --all-targets --locked -- -D warnings; \ | |
| 85 | 85 | cargo test --locked; \ |
| 86 | 86 | for suite in $SUITES; do \ |
| 87 | 87 | set --; \ |
Parents: 4bc5ec8