From a373ed98f3479ed7ae6a142d40c4ebe7b88cabaa Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Sat, 28 Sep 2024 14:51:12 +0200 Subject: [PATCH 1/2] ci: use cargo-about for license checks It seems like the better solution. --- .github/workflows/develop.yml | 4 ++-- .github/workflows/master.yml | 4 ++-- about.toml | 10 ++++++++++ license.py | 19 ------------------- 4 files changed, 14 insertions(+), 23 deletions(-) create mode 100644 about.toml delete mode 100644 license.py diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 538bf21..3aa7402 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -21,8 +21,8 @@ jobs: - name: Run the license check run: | - cargo install cargo-license - cargo license --gitlab --all-features | python3 license.py + cargo install --locked cargo-about + cargo about generate --format json --fail --all-features > /dev/null - name: Run cargo test run: cargo test --all-features diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index f09ce35..824fb26 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -21,8 +21,8 @@ jobs: - name: Run the license check run: | - cargo install cargo-license - cargo license --gitlab --all-features | python3 license.py + cargo install --locked cargo-about + cargo about generate --format json --fail --all-features > /dev/null - name: Run cargo test run: cargo test --all-features diff --git a/about.toml b/about.toml new file mode 100644 index 0000000..905185a --- /dev/null +++ b/about.toml @@ -0,0 +1,10 @@ +accepted = [ + "Apache-2.0", + "MIT", + "BSD-3-Clause", + "Unicode-DFS-2016" +] +ignore-transitive-dependencies = false +ignore-build-dependencies = false +ignore-dev-dependencies = false +no-clearly-defined = true diff --git a/license.py b/license.py deleted file mode 100644 index 41418b5..0000000 --- a/license.py +++ /dev/null @@ -1,19 +0,0 @@ -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 From cbb9a0fa82e19620c6bb7232b005bd8ece49a6eb Mon Sep 17 00:00:00 2001 From: Mathias Hall-Andersen Date: Sat, 28 Sep 2024 15:04:32 +0200 Subject: [PATCH 2/2] ci: fix CI not matching dev branches --- .github/workflows/develop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 3aa7402..1b2b812 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -1,10 +1,12 @@ on: push: branches: + - '**' - "!master" pull_request: branches: + - '**' - "!master" jobs: