Bump toolchain (#76) #114
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: Lint | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | |
jobs: | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
run: rustup component add clippy | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: ${{ github.ref_name == 'main' }} | |
- name: Run cargo clippy with all features enabled | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
rustfmt: | |
if: github.ref_name != 'main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
run: rustup component add rustfmt | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
dprint: | |
if: github.ref_name != 'main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Lint Markdown and TOML | |
uses: dprint/check@v2.2 |