Skip to content

Commit

Permalink
ci: use a new license checker
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander committed Aug 23, 2021
1 parent b7276cd commit c3cd932
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 129 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/license-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# 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 checker

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
check-license:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Check License Header
uses: apache/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
- name: Merge conflict
run: |
grep "^<<<<<<< HEAD" $(git ls-files | grep -v "t/toolkit" | xargs) && exit 1 || true
- name: License
run: |
make license-check
- name: Plugin Code
run: |
sudo bash ./utils/check-plugins-code.sh
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ t/lib/dubbo-backend/dubbo-backend-provider/target/
*.iml
\.*
!.github/
ci/openwhisk-utilities/
!.gitmodules
!.markdownlint.yml
!.yamllint
!.licenserc.yaml
/conf/apisix.yaml
/conf/apisix-*.yaml
/conf/config-*.yaml
Expand Down
42 changes: 42 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# 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.
#
header:
license:
spdx-id: Apache-2.0
copyright-owner: Apache Software Foundation

paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'NOTICE'
- '**/*.json'
- '**/*.key'
- '**/*.crt'
- '**/*.pem'
- '.github/'
- 'conf/mime.types'
# Exclude test toolkit files
- 't/toolkit'
- 't/chaos/go.mod'
- 't/chaos/go.sum'
# Exclude non-Apache licensed files
- 'apisix/balancer/ewma.lua'
# Exclude plugin-specific configuration files
- 't/plugin/authz-casbin'
- 't/coredns'

comment: on-failure
9 changes: 0 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,6 @@ test:
git submodule update --init --recursive
prove -I../test-nginx/lib -I./ -r -s t/

### license-check: Check Lua source code for Apache License
.PHONY: license-check
license-check:
ifeq ("$(wildcard ci/openwhisk-utilities/scancode/scanCode.py)", "")
git clone https://github.com/apache/openwhisk-utilities.git ci/openwhisk-utilities
cp ci/ASF* ci/openwhisk-utilities/scancode/
endif
ci/openwhisk-utilities/scancode/scanCode.py --config ci/ASF-Release.cfg ./

.PHONY: release-src
release-src: compress-tar
gpg --batch --yes --armor --detach-sig $(RELEASE_SRC).tgz
Expand Down
113 changes: 0 additions & 113 deletions ci/ASF-Release.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions ci/linux_openresty_common_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ do_install() {
git clone https://github.com/iresty/test-nginx.git test-nginx
make utils

git clone https://github.com/apache/openwhisk-utilities.git ci/openwhisk-utilities
cp ci/ASF* ci/openwhisk-utilities/scancode/

mkdir -p build-cache
if [ ! -f "build-cache/grpc_server_example_$GRPC_SERVER_EXAMPLE_VER" ]; then
wget https://github.com/api7/grpc_server_example/releases/download/"$GRPC_SERVER_EXAMPLE_VER"/grpc_server_example-amd64.tar.gz
Expand Down

0 comments on commit c3cd932

Please sign in to comment.