ci: install Rust on the Gitea runner and check fmt and clippy
All checks were successful
Rust / check (pull_request) Successful in 5m14s

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.
This commit is contained in:
2026-10-26 20:34:40 +00:00
parent c911fc382e
commit 6d49f9939c

View File

@@ -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