on: [push, pull_request]
name: Lints
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lints:
name: rustfmt and clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- name: Install toolchain
run: rustup toolchain install stable && rustup component add rustfmt && rustup component add clippy
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy --all-features -- -D warnings
- name: Run cargo clippy on tests
run: cargo clippy --all-features --tests -- -D warnings