From 8a70c36c303c3fc9ef6cd74e48c9bbd6b7cf6340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Pa=C4=8Dandi?= <3002868+Dinonard@users.noreply.github.com> Date: Thu, 19 Jan 2023 09:15:19 +0100 Subject: [PATCH] License check CI (#834) --- .github/license-check/config.json | 8 ++++++++ .../license-check/headers/HEADER-GNUv3 | 1 - .github/workflows/static-analysis.yml | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/license-check/config.json rename HEADER-GNUv3 => .github/license-check/headers/HEADER-GNUv3 (99%) diff --git a/.github/license-check/config.json b/.github/license-check/config.json new file mode 100644 index 000000000..0625a49e0 --- /dev/null +++ b/.github/license-check/config.json @@ -0,0 +1,8 @@ +[ + { + "include": [ + "**/*.rs" + ], + "license": "./.github/license-check/headers/HEADER-GNUv3" + } +] diff --git a/HEADER-GNUv3 b/.github/license-check/headers/HEADER-GNUv3 similarity index 99% rename from HEADER-GNUv3 rename to .github/license-check/headers/HEADER-GNUv3 index bb0211d5a..bbb0184fe 100644 --- a/HEADER-GNUv3 +++ b/.github/license-check/headers/HEADER-GNUv3 @@ -15,4 +15,3 @@ // You should have received a copy of the GNU General Public License // along with Astar. If not, see . - diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 41a27d65c..5d9715cc6 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,6 +2,7 @@ name: Static Analysis on: [push, workflow_dispatch] jobs: fmt: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - name: Checkout the source code @@ -29,6 +30,7 @@ jobs: taplo fmt --check clippy: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - name: Checkout the source code @@ -47,3 +49,17 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features -- -D warnings + + check-license: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + - name: Checkout the source code + uses: actions/checkout@v3 + + - name: Check license + uses: viperproject/check-license-header@v2 + with: + path: ./ + config: ./.github/license-check/config.json + strict: false