Skip to content

Commit

Permalink
ci: use a new license checker (#4872)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacewander committed Aug 24, 2021
1 parent 7b52744 commit b8ae382
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 131 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/skywalking-eyes@v0.1.0
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
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ t/lib/dubbo-backend/dubbo-backend-provider/target/
*.iml
\.*
!.github/
ci/openwhisk-utilities/
!.gitmodules
!.markdownlint.yml
!.yamllint
/conf/apisix.yaml
/conf/apisix-*.yaml
/conf/config-*.yaml
!/conf/config-default.yaml
/conf/debug-*.yaml
/build-cache/
!.licenserc.yaml
conf/apisix.yaml
conf/apisix-*.yaml
conf/config-*.yaml
!conf/config-default.yaml
conf/debug-*.yaml
build-cache/
t/fuzzing/__pycache__/
boofuzz-results/
*.pyc
Expand Down
44 changes: 44 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#
# 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'
# eyes has some limitation to handle git pattern
- '**/*.log'
# 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
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,7 @@ test:
### 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 ./
docker run -it --rm -v $(shell pwd):/github/workspace apache/skywalking-eyes header check

.PHONY: release-src
release-src: compress-tar
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 b8ae382

Please sign in to comment.