From 5e2459d559c0c826635a5d5ceb3c6a5088b8699e Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Mon, 3 Jun 2024 14:16:31 +0800 Subject: [PATCH] Refactor license check --- {dev => .github/workflows}/check.py | 0 {dev => .github/workflows}/check.sh | 2 +- .github/workflows/check_license.yml | 36 +++++++++++++++++++++++++++++ .github/workflows/code_style.yml | 12 +--------- 4 files changed, 38 insertions(+), 12 deletions(-) rename {dev => .github/workflows}/check.py (100%) rename {dev => .github/workflows}/check.sh (97%) create mode 100644 .github/workflows/check_license.yml diff --git a/dev/check.py b/.github/workflows/check.py similarity index 100% rename from dev/check.py rename to .github/workflows/check.py diff --git a/dev/check.sh b/.github/workflows/check.sh similarity index 97% rename from dev/check.sh rename to .github/workflows/check.sh index 9b940845f92dd..42e9e342d137c 100755 --- a/dev/check.sh +++ b/.github/workflows/check.sh @@ -15,7 +15,7 @@ # limitations under the License. export BASE_COMMIT=$1 -dev/check.py header branch +check.py header branch if [ $? -ne 0 ]; then dev/check.py header branch --fix echo -e "\n==== Apply using:" diff --git a/.github/workflows/check_license.yml b/.github/workflows/check_license.yml new file mode 100644 index 0000000000000..f2402ed1ea663 --- /dev/null +++ b/.github/workflows/check_license.yml @@ -0,0 +1,36 @@ +# 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. + +name: license header check + +on: + pull_request + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + license-check: + name: License Header Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check License Header + run: | + git fetch --recurse-submodules=no origin main ${{github.event.pull_request.base.sha}} + pip install regex + cd $GITHUB_WORKSPACE/.github/workflows/ + check.sh ${{github.event.pull_request.base.sha}} diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml index 7740ae9926a16..bea31a99ee74d 100644 --- a/.github/workflows/code_style.yml +++ b/.github/workflows/code_style.yml @@ -62,14 +62,4 @@ jobs: git diff -- '*CMakeLists.txt' '*.cmake' exit 1 fi - - license-check: - name: License Header Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Check License Header - run: | - git fetch --recurse-submodules=no origin main ${{github.event.pull_request.base.sha}} - pip install regex - dev/check.sh ${{github.event.pull_request.base.sha}} + echo "No CMake format issue."