-
Notifications
You must be signed in to change notification settings - Fork 16
80 lines (63 loc) · 2.51 KB
/
lint.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: "lint"
permissions: {}
on:
pull_request:
env:
RUSTFLAGS: -Dwarnings
jobs:
cargo-fmt:
name: "cargo fmt"
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- id: toolchain
uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a # doesn't have usual versioned releases/tags
with:
toolchain: stable
components: rustfmt # minimal profile does not include it
- run: cargo +${{ steps.toolchain.outputs.name }} fmt --all --check
cargo-clippy:
name: "cargo clippy"
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- id: toolchain
uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a # doesn't have usual versioned releases/tags
with:
toolchain: stable
components: clippy # minimal profile does not include it
- run: cargo +${{ steps.toolchain.outputs.name }} clippy --all-targets --all-features
cargo-rustdoc-clippy:
name: "cargo rustdoc-clippy"
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
with:
egress-policy: audit
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- id: toolchain
uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716e7a6d9b65c4cc244a1a # doesn't have usual versioned releases/tags
with:
toolchain: nightly
components: clippy # minimal profile does not include it
# dependency of cargo-rustdoc-clippy
- run: |
sudo apt-get update
sudo apt-get install zsh
# https://github.com/rust-lang/rust/issues/56232#issuecomment-1248359946
- run: |
curl --output ~/.cargo/bin/cargo-rustdoc-clippy https://raw.githubusercontent.com/Nemo157/dotfiles/e6daf083068ff17d14b19dc2569ae62ea86bf23c/bin/cargo-rustdoc-clippy
chmod +x ~/.cargo/bin/cargo-rustdoc-clippy
- run: cargo +${{ steps.toolchain.outputs.name }} rustdoc-clippy --all-features