Skip to content

Commit 6630dca

Browse files
authored
add cargo deny to CI (gitui-org#1285)
* check duplicate dependencies * also use cargo-deny for licenses checking * also run cargo deny check in make check
1 parent d4949a6 commit 6630dca

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

.github/workflows/ci.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ jobs:
118118
run: |
119119
make test-linux-musl
120120
121-
rustfmt:
122-
name: Formatting
121+
linting:
122+
name: Lints
123123
runs-on: ubuntu-latest
124124
steps:
125125
- uses: actions/checkout@master
@@ -128,13 +128,26 @@ jobs:
128128
with:
129129
toolchain: stable
130130
components: rustfmt
131+
131132
- run: cargo fmt -- --check
132133

133134
- name: cargo-sort
134135
run: |
135136
cargo install cargo-sort --force
136137
cargo sort -c -w
137138
139+
- name: cargo-deny install
140+
run: |
141+
cargo install --locked cargo-deny
142+
143+
- name: cargo-deny licenses
144+
run: |
145+
cargo deny check licenses
146+
147+
- name: cargo-deny bans
148+
run: |
149+
cargo deny check bans
150+
138151
sec:
139152
name: Security audit
140153
runs-on: ubuntu-latest

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ clippy:
5757
clippy-nightly:
5858
cargo +nightly clippy --workspace --all-features
5959

60-
check: fmt clippy test
60+
check: fmt clippy test deny
61+
62+
deny:
63+
cargo deny check
6164

6265
install:
6366
cargo install --path "." --offline

deny.toml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[licenses]
2+
unlicensed = "deny"
3+
allow = [
4+
"MIT",
5+
"Apache-2.0",
6+
"BSD-2-Clause",
7+
"BSD-3-Clause"
8+
]
9+
copyleft = "warn"
10+
allow-osi-fsf-free = "neither"
11+
default = "deny"
12+
confidence-threshold = 0.9
13+
14+
[[licenses.exceptions]]
15+
allow = ["Unicode-DFS-2016"]
16+
name = "unicode-ident"
17+
version = "1.0.3"
18+
19+
[bans]
20+
multiple-versions = "deny"

0 commit comments

Comments
 (0)