build(CI): add cargo clippy (#122)

This commit is contained in:
HAOYUatHZ 2022-12-02 09:21:20 +08:00 committed by GitHub
parent 161e0fbfb9
commit e4071fea6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 1 deletions

View File

@ -60,7 +60,7 @@ jobs:
profile: minimal profile: minimal
toolchain: nightly toolchain: nightly
override: true override: true
- run: rustup component add rustfmt components: rustfmt
- uses: actions/cache@v2 - uses: actions/cache@v2
with: with:
path: | path: |
@ -72,3 +72,26 @@ jobs:
with: with:
command: fmt command: fmt
args: --all -- --check args: --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: clippy
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-target-${{ hashFiles('Cargo.lock') }}
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -D warnings