feat: add Rust quality checks workflow for CI

This commit is contained in:
MayaTheShy
2025-11-08 21:24:48 -05:00
parent cfd1e5588d
commit e4d669f14c

View File

@@ -0,0 +1,67 @@
name: Rust Quality Checks
on:
push:
branches: [ main, dev ]
paths:
- 'bridge/**'
- '.gitea/workflows/rust-quality.yml'
pull_request:
branches: [ main ]
paths:
- 'bridge/**'
jobs:
rust-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Rust nightly
uses: https://github.com/actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
bridge/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('bridge/Cargo.lock', 'bridge/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Check formatting
run: |
cd bridge
cargo fmt -- --check
- name: Run clippy
run: |
cd bridge
cargo clippy --all-targets --all-features -- -D warnings
- name: Check for unused dependencies
run: |
cd bridge
cargo install cargo-udeps --locked || true
cargo +nightly udeps || true
- name: Security audit
run: |
cd bridge
cargo install cargo-audit --locked || true
cargo audit || true
- name: Build documentation
run: |
cd bridge
cargo doc --no-deps --document-private-items