Skip to content

Commit

Permalink
CI: Check licenses of all dependencies (#17)
Browse files Browse the repository at this point in the history
* ci: check licenses of dependencies
* ci: license, check --all-features
  • Loading branch information
rot256 authored Sep 22, 2024
1 parent a216925 commit b500ae4
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
targets: wasm32-unknown-unknown
components: rustfmt, clippy

- name: Run the license check
run: |
cargo install cargo-license
cargo license --gitlab --all-features | python3 license.py
- name: Run cargo test
run: cargo test --all-features

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
targets: wasm32-unknown-unknown
components: rustfmt, clippy

- name: Run the license check
run: |
cargo install cargo-license
cargo license --gitlab --all-features | python3 license.py
- name: Run cargo test
run: cargo test --all-features

Expand Down
1 change: 1 addition & 0 deletions channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "channel"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
ark-ff.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions commitment_scheme/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "commitment_scheme"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
ark-ff.workspace = true
Expand All @@ -10,10 +11,10 @@ sha3.workspace = true
poseidon = { path = "../poseidon" }
felt = { path = "../felt" }
channel = { path = "../channel" }
randomness ={ path = "../randomness" }
randomness = { path = "../randomness" }
anyhow.workspace = true
num-bigint.workspace = true

[dev-dependencies]
hex.workspace = true
rand.workspace = true
hex.workspace = true
rand.workspace = true
1 change: 1 addition & 0 deletions felt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "felt"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
ark-ff.workspace = true
1 change: 1 addition & 0 deletions fri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "fri"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
ark-ff.workspace = true
Expand Down
19 changes: 19 additions & 0 deletions license.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import sys
import json

# check the license before adding it here:
# we want to avoid viral licenses like GPL
ALLOWED = {
"Unlicense",
"MIT",
"Apache-2.0",
"BSL-1.0",
"Unicode-DFS-2016",
"BSD-3-Clause",
}

licenses = json.loads(sys.stdin.read())

for dep in licenses["dependencies"]:
print(f'{dep["name"]}-{dep["version"]}: {", ".join(dep["licenses"])}')
assert len(set(dep["licenses"]).intersection(ALLOWED)) > 0, dep
1 change: 1 addition & 0 deletions poseidon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "poseidon"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
ark-ff.workspace = true
Expand Down
1 change: 1 addition & 0 deletions randomness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "randomness"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
ark-ff.workspace = true
Expand Down

0 comments on commit b500ae4

Please sign in to comment.