Skip to content

Commit

Permalink
SINGA-508 Add Apache RAT licence check with Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Moaz Reyad committed Mar 15, 2020
1 parent 001ba4c commit 1bd7b96
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/rat.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.
#

# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "CheckLicence"
CheckLicence:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Licence check with Apache RAT
run: bash -ex tool/rat.sh
17 changes: 17 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 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.
#

[MASTER]

errors-only=yes
Expand Down
41 changes: 39 additions & 2 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
Expand All @@ -52,4 +52,41 @@
<scope>compile</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>check-licence</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>0.13</version>
<configuration>
<excludes combine.children="append">
<exclude>rafiki/**</exclude>
<exclude>test/gtest/**</exclude>
<exclude>include/singa/utils/tinydir.h</exclude>
<exclude>include/singa/utils/cuda_utils.h</exclude>
<exclude>src/core/tensor/distribution.cl</exclude>
<exclude>src/model/layer/im2col.cl</exclude>
<exclude>src/model/layer/pooling.cl</exclude>
<exclude>src/proto/caffe.proto</exclude>
<exclude>cmake/Thirdparty/FindViennaCL.cmake</exclude>
<exclude>cmake/Thirdparty/FindOpenCL.cmake</exclude>
<exclude>src/api/numpy.i</exclude>
<exclude>doc/en/docs/notebook/utils.py</exclude>
<exclude>examples/imagenet/inception/convert.py</exclude>
<exclude>tool/cpplint.py</exclude>
<exclude>travis*.log</exclude>
<exclude>.gitmodules</exclude>
<exclude>java/target/*</exclude>
<exclude>miniconda.sh</exclude>
</excludes>
<consoleOutput>True</consoleOutput>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
3 changes: 0 additions & 3 deletions rat-excludes

This file was deleted.

17 changes: 17 additions & 0 deletions test/python/cuda_helper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 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.
#

from singa import device

# avoid singleton error
Expand Down
16 changes: 16 additions & 0 deletions test/python/test_memoryPool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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.
#
19 changes: 19 additions & 0 deletions tool/rat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.
#

cd java
mvn apache-rat:check -Pcheck-licence -Drat.basedir=..

0 comments on commit 1bd7b96

Please sign in to comment.