-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (38 loc) · 1.24 KB
/
clippy-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
on: [pull_request]
name: Clippy
env:
RUST_VERSION: nightly-2022-09-13
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
components: clippy, rustfmt
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Cache packages
id: cache-cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('**/Cargo.lock') }}-clippy
restore-keys: |
${{ runner.os }}-cargo-${{ env.RUST_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
${{ runner.os }}-cargo-${{ env.RUST_VERSION }}
- uses: actions-rs/cargo@v1
with:
command: fmt
toolchain: ${{ env.RUST_VERSION }}
args: --all -- --check
- name: Install cargo-lints
# Cargo lints is most likely already installed in the cache, so || true to prevent failure
run: cargo install cargo-lints || true
- name: Clippy lints
run: cargo lints clippy --all-targets