From e260f541728d846e79cc6f20eca69fe983606fb6 Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Thu, 24 Oct 2024 11:16:38 +0800 Subject: [PATCH] feat: Add Cargo Deny license check to CI workflow (#131) * feat: Add Cargo Deny license check to CI workflow Signed-off-by: Ruihang Xia * only check license Signed-off-by: Ruihang Xia --------- Signed-off-by: Ruihang Xia --- .github/workflows/ci.yml | 10 ++++++++++ deny.toml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 deny.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ce60634..f897ed0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,6 +125,16 @@ jobs: - name: Run cargo clippy run: cargo clippy --workspace --all-targets ${{ matrix.features }} -- -D warnings + cargo-deny: + name: Cargo Deny License Check + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check license + coverage: if: github.event.pull_request.draft == false runs-on: ubuntu-latest diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000..da1913ef --- /dev/null +++ b/deny.toml @@ -0,0 +1,30 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +[licenses] +allow = [ + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "MIT", + "BSD-2-Clause", + "BSD-3-Clause", + "CC0-1.0", +] +exceptions = [ + { allow = ["Unicode-DFS-2016"], name = "unicode-ident" }, +] +version = 2