From 6d49f9939ce8129c300896e7feeb0d1fe24342d0 Mon Sep 17 00:00:00 2001 From: Andre Cipriani Bandarra Date: Mon, 26 Oct 2026 20:34:40 +0000 Subject: [PATCH] ci: install Rust on the Gitea runner and check fmt and clippy The Gitea runner image doesn't include Rust, so every job failed at 'cargo: command not found'. Install the stable toolchain, cache the build, and run cargo fmt --check and clippy alongside the tests. --- .github/workflows/rust.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9fd45e0..7d466fd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,13 +10,19 @@ env: CARGO_TERM_COLOR: always jobs: - build: - + check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + # The Gitea runner image doesn't ship with Rust, unlike GitHub's. + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + - name: Format + run: cargo fmt --check + - name: Clippy + run: cargo clippy --all-targets -- -D warnings + - name: Test + run: cargo test