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
toolchain: nightly
override: true
- run: rustup component add rustfmt
components: rustfmt
- uses: actions/cache@v2
with:
path: |
@ -72,3 +72,26 @@ jobs:
with:
command: fmt
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