feat: add Rust quality checks workflow for CI
This commit is contained in:
67
.gitea/workflows/rust-quality.yml
Normal file
67
.gitea/workflows/rust-quality.yml
Normal 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
|
||||||
Reference in New Issue
Block a user