-
-
Notifications
You must be signed in to change notification settings - Fork 2
134 lines (117 loc) · 4.57 KB
/
Copy pathlint.yml
File metadata and controls
134 lines (117 loc) · 4.57 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Lint
on: [ push, pull_request ]
permissions:
contents: read
jobs:
rust:
name: Cargo clippy & fmt
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
crates.io:443
github.com:443
index.crates.io:443
release-assets.githubusercontent.com:443
static.crates.io:443
static.rust-lang.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Rust toolchain
run: rustup show && rustup update
- name: cargo fmt
run: cargo fmt -- --check
- name: cargo clippy
run: cargo clippy --workspace --all-features --tests -- -D warnings
check-spdx-headers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: enarx/spdx@b5bfdd4410071bf058c8333d0e70020001524b6b # master
with:
licenses: Apache-2.0
udeps:
name: Unused dependencies
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
crates.io:443
github.com:443
index.crates.io:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
static.crates.io:443
static.rust-lang.org:443
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@53c04d3685fcc3ca67ce478eb9c2ea5c051a4a63 # nightly
- name: Install cargo-udeps
run: |
wget https://github.com/est31/cargo-udeps/releases/download/v0.1.54/cargo-udeps-v0.1.54-x86_64-unknown-linux-musl.tar.gz
tar -xzf cargo-udeps-v0.1.54-x86_64-unknown-linux-musl.tar.gz
mv cargo-udeps-v0.1.54-x86_64-unknown-linux-musl/cargo-udeps ~/.cargo/bin/
- name: Run udeps
run: cargo +nightly udeps
audit:
name: Cargo Audit & Deny
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
crates.io:443
github.com:443
index.crates.io:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
static.crates.io:443
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Cargo Audit & Deny
run: |
wget https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv0.21.2/cargo-audit-x86_64-unknown-linux-musl-v0.21.2.tgz
tar -xzf cargo-audit-x86_64-unknown-linux-musl-v0.21.2.tgz
mv cargo-audit-x86_64-unknown-linux-musl-v0.21.2/cargo-audit ~/.cargo/bin/
wget https://github.com/EmbarkStudios/cargo-deny/releases/download/0.18.2/cargo-deny-0.18.2-x86_64-unknown-linux-musl.tar.gz
tar -xzf cargo-deny-0.18.2-x86_64-unknown-linux-musl.tar.gz
mv cargo-deny-0.18.2-x86_64-unknown-linux-musl/cargo-deny ~/.cargo/bin/
- name: Run Cargo Audit
run: cargo audit
- name: Run Cargo deny
run: cargo deny --all-features check
hack:
name: Cargo Hack
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
crates.io:443
github.com:443
index.crates.io:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
static.crates.io:443
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Cargo Hack
uses: taiki-e/install-action@3aeb53dd041c652ad28c1714cb9a10a4fbde32ff # cargo-hack
- name: Run Cargo Hack
run: cargo hack check --each-feature --no-dev-deps