You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2020/03/16 14:58:13 UTC
[singa] branch dev updated: SINGA-508 Add Apache RAT licence check
with Github Actions
This is an automated email from the ASF dual-hosted git repository.
wangwei pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/singa.git
The following commit(s) were added to refs/heads/dev by this push:
new 1bd7b96 SINGA-508 Add Apache RAT licence check with Github Actions
new 5b47811 Merge pull request #629 from moazreyad/dev
1bd7b96 is described below
commit 1bd7b9638b571b774d000feec68c73dd0d8bef49
Author: Moaz Reyad <mo...@apache.org>
AuthorDate: Sun Mar 15 10:29:27 2020 +0100
SINGA-508 Add Apache RAT licence check with Github Actions
---
.github/workflows/rat.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++
.pylintrc | 17 ++++++++++++++++
java/pom.xml | 41 +++++++++++++++++++++++++++++++++++++--
rat-excludes | 3 ---
test/python/cuda_helper.py | 17 ++++++++++++++++
test/python/test_memoryPool.py | 16 +++++++++++++++
tool/rat.sh | 19 ++++++++++++++++++
7 files changed, 152 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/rat.yaml b/.github/workflows/rat.yaml
new file mode 100644
index 0000000..d3462e0
--- /dev/null
+++ b/.github/workflows/rat.yaml
@@ -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
diff --git a/.pylintrc b/.pylintrc
index 0e5981b..ca4161a 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -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
diff --git a/java/pom.xml b/java/pom.xml
index b91d65c..1b1428b 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -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>
@@ -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>
diff --git a/rat-excludes b/rat-excludes
deleted file mode 100644
index dd28d62..0000000
--- a/rat-excludes
+++ /dev/null
@@ -1,3 +0,0 @@
-rat-excludes
-# Apache Rat cannot recognize the license header in jupyter notebooks
-.*\.ipynb
\ No newline at end of file
diff --git a/test/python/cuda_helper.py b/test/python/cuda_helper.py
index 516b9a3..36e7e85 100644
--- a/test/python/cuda_helper.py
+++ b/test/python/cuda_helper.py
@@ -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
diff --git a/test/python/test_memoryPool.py b/test/python/test_memoryPool.py
index e69de29..ae00986 100644
--- a/test/python/test_memoryPool.py
+++ b/test/python/test_memoryPool.py
@@ -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.
+#
diff --git a/tool/rat.sh b/tool/rat.sh
new file mode 100644
index 0000000..df28f69
--- /dev/null
+++ b/tool/rat.sh
@@ -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=..