Skip to content

Commit 7283fe9

Browse files
authored
chore(ci): Validate cargo-deny output in CI and check license compatibility (#1016)
* chore(ci): Verify license compatibility using cargo-deny Signed-off-by: Jesse Szwedko <[email protected]> * Add GitHub workflow to check deny Signed-off-by: Jesse Szwedko <[email protected]> * Remove deprecated configuration Was using an old version of cargo-deny when I updated this confg Signed-off-by: Jesse Szwedko <[email protected]> --------- Signed-off-by: Jesse Szwedko <[email protected]>
1 parent 5f635f9 commit 7283fe9

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ jobs:
8888
- name: "Check that the MSRV is up to date"
8989
run: ./scripts/check_msrv.sh
9090

91+
check-deny:
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v4
95+
- uses: Swatinem/rust-cache@v2
96+
- name: "Check that the 3rd-party license file is up to date"
97+
run: ./scripts/check_deny.sh
98+
9199
wasm32-unknown-unknown:
92100
runs-on: ubuntu-latest
93101
steps:

deny.toml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
[licenses]
22
allow = [
3-
"MIT",
3+
"0BSD",
4+
"Apache-2.0 WITH LLVM-exception",
5+
"Apache-2.0",
6+
"BSD-2-Clause",
7+
"BSD-3-Clause",
8+
"BSL-1.0",
49
"CC0-1.0",
510
"ISC",
11+
"MIT",
612
"OpenSSL",
713
"Unicode-3.0",
14+
"Unicode-DFS-2016",
815
"Unlicense",
9-
"BSD-2-Clause",
10-
"BSD-3-Clause",
11-
"Apache-2.0",
12-
"Apache-2.0 WITH LLVM-exception",
1316
"Zlib",
1417
]
1518

16-
unlicensed = "warn"
17-
default = "warn"
18-
1919
private = { ignore = true }
2020

21+
exceptions = [
22+
# MPL-2.0 are added case-by-case to make sure we are in compliance. To be in
23+
# compliance we cannot be modifying the source files.
24+
{ allow = ["MPL-2.0"], name = "vrl", version = "*" },
25+
]
26+
2127
[[licenses.clarify]]
2228
name = "ring"
2329
version = "*"
2430
expression = "MIT AND ISC AND OpenSSL"
2531
license-files = [
2632
{ path = "LICENSE", hash = 0xbd0eed23 }
2733
]
34+
35+
[advisories]
36+
ignore = [
37+
# ansi_term is Unmaintained
38+
# Only used when test_framework feature is enabled for tests
39+
# TODO: We should swap this out for a maintained library
40+
"RUSTSEC-2021-0139"
41+
]

scripts/check_deny.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
if ! cargo install --list | grep -q "cargo-deny v0.16.1"; then
4+
echo "Install cargo-deny"
5+
cargo install cargo-deny --version 0.16.1 --force --locked
6+
fi
7+
8+
echo "Check deny"
9+
cargo deny --log-level error --all-features check all

0 commit comments

Comments
 (0)