KER-1: Set up a pipeline for formatting & linting checks #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: "Check formatting and linting" | |
on: | |
push: | |
branches: | |
- "master" | |
pull_request: | |
branches: | |
- "master" | |
env: | |
CARGO_TERM_COLOR: "always" | |
jobs: | |
format-and-lint: | |
name: "Check formatting and linting" | |
runs-on: ["ubuntu-latest"] | |
steps: | |
- id: "checkout" | |
name: "Checkout repository" | |
uses: "actions/checkout@v4" | |
with: | |
filter: "tree:0" | |
- id: "setup-toolchain" | |
name: "Install Rust toolchain" | |
uses: "dtolnay/rust-toolchain@master" | |
with: | |
toolchain: "stable" | |
- id: "setup-cache" | |
name: "Cache dependencies" | |
uses: "Swatinem/rust-cache@v2" | |
- id: "fmt" | |
name: "Check formatting" | |
run: | | |
cargo fmt --all -- --check | |
- id: "clippy" | |
name: "Run clippy" | |
run: | | |
cargo clippy -- -D warnings |