name: lint
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Install Rust
uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c with:
components: rustfmt, clippy
- name: Cache cargo
uses: Swatinem/rust-cache@8cbdedb5103daa674dcf46d3590fe06a76645684
- name: rustfmt
run: cargo fmt --all --check
- name: clippy
run: cargo clippy --all-targets --all-features -- -D warnings