Skip to content

Commit 220df53

Browse files
committed
ci: add licenses.yml workflow & deny.yml to check licenses using cargo-deny
1 parent affa665 commit 220df53

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

.github/workflows/licenses.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Check Licenses
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
- "hotfix**"
8+
paths:
9+
- "**/Cargo.lock"
10+
- "**/Cargo.toml"
11+
- "**/deny.toml"
12+
pull_request:
13+
types: [opened, reopened, synchronize]
14+
paths:
15+
- "**/Cargo.lock"
16+
- "**/Cargo.toml"
17+
- "**/deny.toml"
18+
branches-ignore:
19+
- "hotfix**" # hotfix are handled by the push trigger
20+
21+
concurrency:
22+
group: licences-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
cargo-deny:
27+
runs-on: ubuntu-22.04
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
## Note about deny command options:
33+
## `--no-default-features` is only available when running against one crate
34+
35+
# Global
36+
- deny-args: ""
37+
manifest-path: ./Cargo.toml
38+
- deny-args: "--all-features"
39+
manifest-path: ./Cargo.toml
40+
- deny-args: "--features rug-backend"
41+
manifest-path: ./Cargo.toml
42+
- deny-args: "--features num-integer-backend"
43+
manifest-path: ./Cargo.toml
44+
- deny-args: "--features jemallocator"
45+
manifest-path: ./Cargo.toml
46+
- deny-args: "--features bundle_tls"
47+
manifest-path: ./Cargo.toml
48+
49+
# Mithril Client
50+
- deny-args: ""
51+
manifest-path: mithril-client/Cargo.toml
52+
- deny-args: "--all-features"
53+
manifest-path: mithril-client/Cargo.toml
54+
- deny-args: "--no-default-features"
55+
manifest-path: mithril-client/Cargo.toml
56+
57+
# Mithril Client WASM
58+
- deny-args: ""
59+
manifest-path: mithril-client-wasm/Cargo.toml
60+
steps:
61+
- uses: actions/checkout@v5
62+
63+
- uses: EmbarkStudios/cargo-deny-action@v2
64+
with:
65+
command: check licenses
66+
arguments: ${{ matrix.deny-args }}
67+
log-level: error
68+
manifest-path: ${{ matrix.manifest-path }}

deny.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Cargo-deny configuration file
2+
3+
[graph]
4+
targets = [
5+
"aarch64-apple-darwin",
6+
"aarch64-unknown-linux-gnu",
7+
"x86_64-pc-windows-msvc",
8+
"x86_64-unknown-linux-gnu",
9+
"x86_64-unknown-linux-musl",
10+
"wasm32-unknown-unknown"
11+
]
12+
13+
[licenses]
14+
# We want really high confidence when inferring licenses from text
15+
confidence-threshold = 0.93
16+
# This list of allowed licenses is not final and is currently under legal investigation. It may be updated in the future.
17+
allow = [
18+
"Apache-2.0",
19+
"BlueOak-1.0.0",
20+
"BSD-2-Clause",
21+
"BSD-3-Clause",
22+
"bzip2-1.0.6",
23+
"CC0-1.0",
24+
"CDLA-Permissive-2.0",
25+
"ISC",
26+
"LGPL-3.0-or-later",
27+
"MIT",
28+
"MIT-0",
29+
"MPL-2.0",
30+
"Unicode-3.0",
31+
"Zlib",
32+
]
33+

0 commit comments

Comments
 (0)