Add general-rust ci #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: General Rust CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "apps/cargo-scout-audit/**" | |
pull_request: | |
paths: | |
- "apps/cargo-scout-audit/**" | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
format: | |
name: Check Rust Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Update Rust Toolchain | |
run: rustup update | |
- name: Install rustfmt | |
run: rustup component add rustfmt | |
- name: Check Formatting | |
run: cd apps/cargo-scout-audit && cargo fmt -- --check | |
clippy: | |
name: Lint with Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Cache Rust Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./apps/cargo-scout-audit/target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('apps/cargo-scout-audit/Cargo.lock') }} | |
- name: Update Rust Toolchain | |
run: rustup update | |
- name: Install clippy | |
run: rustup component add clippy | |
- name: Lint Code | |
run: cd apps/cargo-scout-audit && cargo clippy --all-targets --all-features -- -D warnings | |
udeps: | |
name: Check Unused Dependencies with cargo-udeps | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Cache Rust Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
./apps/cargo-scout-audit/target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('apps/cargo-scout-audit/Cargo.lock') }} | |
- name: Update Rust Toolchain | |
run: rustup update | |
- name: Install cargo-udeps | |
run: cargo install cargo-udeps | |
- name: Check Unused Dependencies | |
run: cd apps/cargo-scout-audit && cargo udeps --all-targets |