From e4071fea6e713761ccf6c97d9bc875d5b5857f6e Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Fri, 2 Dec 2022 09:21:20 +0800 Subject: [PATCH] build(CI): add cargo clippy (#122) --- .github/workflows/test.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9280d52..fe102de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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