Skip to content

Commit 16c7834

Browse files
authored
ci(lint): update workflows of toolchain and clippy
1 parent 8563baf commit 16c7834

1 file changed

Lines changed: 20 additions & 41 deletions

File tree

.github/workflows/cargo-lint.yml

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ name: Cargo Lint
22

33
on:
44
push:
5-
branches:
6-
- main
7-
- dev
8-
pull_request:
9-
types: [ready_for_review, opened, synchronize, reopened]
10-
paths:
11-
- '**.rs'
12-
- '**/Cargo.toml'
135
workflow_dispatch:
146

157
jobs:
@@ -20,20 +12,16 @@ jobs:
2012
- name: Checkout
2113
uses: actions/checkout@v2
2214

23-
- name: Install latest nightly
24-
uses: actions-rs/toolchain@v1
15+
- name: Install latest stable
16+
uses: dtolnay/rust-toolchain@stable
2517
with:
2618
toolchain: stable
27-
override: true
28-
components: rustfmt, clippy
2919

30-
# `cargo check` command here will use installed `nightly`
31-
# as it is set as an "override" for current directory
3220
- name: deal with rust cache
3321
uses: Swatinem/rust-cache@v1
3422

3523
- name: cargo check
36-
run: cargo check --all-targets --workspace
24+
run: cargo check --all-targets --all-features --workspace
3725

3826
cargo-build:
3927
runs-on: ubuntu-latest
@@ -42,20 +30,16 @@ jobs:
4230
- name: Checkout
4331
uses: actions/checkout@v2
4432

45-
- name: Install latest nightly
46-
uses: actions-rs/toolchain@v1
33+
- name: Install latest stable
34+
uses: dtolnay/rust-toolchain@stable
4735
with:
4836
toolchain: stable
49-
override: true
50-
components: rustfmt, clippy
5137

52-
# `cargo check` command here will use installed `nightly`
53-
# as it is set as an "override" for current directory
5438
- name: deal with rust cache
5539
uses: Swatinem/rust-cache@v1
5640

5741
- name: cargo build
58-
run: cargo build --workspace
42+
run: cargo build --all-features
5943

6044
cargo-clippy:
6145
runs-on: ubuntu-latest
@@ -64,25 +48,23 @@ jobs:
6448
- name: Checkout
6549
uses: actions/checkout@v2
6650

67-
- name: Install latest nightly
68-
uses: actions-rs/toolchain@v1
51+
- name: Install latest stable
52+
uses: dtolnay/rust-toolchain@stable
6953
with:
7054
toolchain: stable
71-
override: true
72-
components: rustfmt, clippy
55+
components: clippy
7356

74-
# `cargo check` command here will use installed `nightly`
75-
# as it is set as an "override" for current directory
7657
- name: deal with rust cache
7758
uses: Swatinem/rust-cache@v1
59+
- run: cargo clippy --workspace --all-features --tests -- -Dwarnings
7860

79-
# temporarily change to a self-maintained workflow
80-
# see https://github.com/actions-rs/clippy-check/pull/158
81-
- name: cargo clippy
82-
uses: BobAnkh/clippy-check@master
83-
with:
84-
token: ${{ secrets.GITHUB_TOKEN }}
85-
args: --all-features --workspace
61+
# temporarily change to a self-maintained workflow
62+
# see https://github.com/actions-rs/clippy-check/pull/158
63+
# - name: cargo clippy
64+
# uses: BobAnkh/clippy-check@master
65+
# with:
66+
# token: ${{ secrets.GITHUB_TOKEN }}
67+
# args: --all-targets --all-features --workspace --no-deps
8668

8769
cargo-fmt:
8870
runs-on: ubuntu-latest
@@ -91,15 +73,12 @@ jobs:
9173
- name: Checkout
9274
uses: actions/checkout@v2
9375

94-
- name: Install latest nightly
95-
uses: actions-rs/toolchain@v1
76+
- name: Install latest stable
77+
uses: dtolnay/rust-toolchain@stable
9678
with:
9779
toolchain: stable
98-
override: true
99-
components: rustfmt, clippy
80+
components: rustfmt
10081

101-
# `cargo check` command here will use installed `nightly`
102-
# as it is set as an "override" for current directory
10382
- name: deal with rust cache
10483
uses: Swatinem/rust-cache@v1
10584

0 commit comments

Comments
 (0)