Skip to content

ci-cd:add PR workflow #4

ci-cd:add PR workflow

ci-cd:add PR workflow #4

Workflow file for this run

name: Lint and Format
on:
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Rustfmt [Formatter]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Build | Format
run: cargo fmt --all -- --check
# Run the `clippy` linting tool
clippy:
name: Clippy [Linter]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Setup | Cache
uses: Swatinem/rust-cache@v2
- name: Build | Lint
uses: giraffate/clippy-action@94e9bd8deab2618756ec5380f12eb35bcb0a88ca
# Ensure that the project could be successfully compiled
cargo_check:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup | Cache
uses: Swatinem/rust-cache@v2
- name: Build | Check
run: cargo check --workspace --locked