Skip to content

chore(ci): Validate cargo-deny output in CI and check license compatibility #1016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ jobs:
- name: "Check that the MSRV is up to date"
run: ./scripts/check_msrv.sh

check-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: "Check that the 3rd-party license file is up to date"
run: ./scripts/check_deny.sh

wasm32-unknown-unknown:
runs-on: ubuntu-latest
steps:
Expand Down
30 changes: 22 additions & 8 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
[licenses]
allow = [
"MIT",
Copy link
Member Author

@jszwedko jszwedko Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorted this list and added 0BSD, BSL-1.0, and Unicode-DFS-2016 based on Vector's deny.toml.

"0BSD",
"Apache-2.0 WITH LLVM-exception",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"BSL-1.0",
"CC0-1.0",
"ISC",
"MIT",
"OpenSSL",
"Unicode-3.0",
"Unicode-DFS-2016",
"Unlicense",
"BSD-2-Clause",
"BSD-3-Clause",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"Zlib",
]

unlicensed = "warn"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These config options default to error now after EmbarkStudios/cargo-deny#611

default = "warn"

private = { ignore = true }

exceptions = [
# MPL-2.0 are added case-by-case to make sure we are in compliance. To be in
# compliance we cannot be modifying the source files.
{ allow = ["MPL-2.0"], name = "vrl", version = "*" },
]

[[licenses.clarify]]
name = "ring"
version = "*"
expression = "MIT AND ISC AND OpenSSL"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]

[advisories]
ignore = [
# ansi_term is Unmaintained
# Only used when test_framework feature is enabled for tests
# TODO: We should swap this out for a maintained library
"RUSTSEC-2021-0139"
]
9 changes: 9 additions & 0 deletions scripts/check_deny.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

if ! cargo install --list | grep -q "cargo-deny v0.16.1"; then
echo "Install cargo-deny"
cargo install cargo-deny --version 0.16.1 --force --locked
fi

echo "Check deny"
cargo deny --log-level error --all-features check all
Loading