Add rust lint CI job.
Some checks failed
Check / Check Rust (pull_request) Failing after 0s

This commit is contained in:
Drew 2025-12-13 23:16:33 -08:00
parent 311755c812
commit 71d6d632db
29 changed files with 180 additions and 107 deletions

46
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,46 @@
name: Check
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
# Should speed up builds.
CARGO_INCREMENTAL: 0
# Should reduce the size of ./target to improve cache load/store.
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
check:
name: Check Rust
runs-on: docker
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Install Rust
uses: https://codeberg.org/wackbyte/rust-toolchain@trunk
with:
toolchain: stable
components: rustfmt, clippy
- name: Cache
uses: https://github.com/Swatinem/rust-cache@v2
with:
# Don't cache ~/.cargo/bin since we restore the cache after we install things there
cache-bin: "false"
workspaces: "backend"
- name: "Check Format"
run: cargo fmt --check
working-directory: rust
- name: "Build"
run: |
cargo build --tests --locked
working-directory: rust
- name: "Lint"
run: |
rustup component add clippy
cargo clippy --locked -- -D warnings
working-directory: rust