diff --git a/.github/workflows/rat.yaml b/.github/workflows/rat.yaml
new file mode 100644
index 0000000000..d3462e0cb6
--- /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 0e5981b5ad..ca4161a07e 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 b91d65c52b..1b1428b011 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -31,8 +31,8 @@
org.apache.maven.pluginsmaven-compiler-plugin
-
- 1.5
+
+ 1.8
@@ -52,4 +52,41 @@
compile
+
+
+ check-licence
+
+
+
+ org.apache.rat
+ apache-rat-plugin
+ 0.13
+
+
+ rafiki/**
+ test/gtest/**
+ include/singa/utils/tinydir.h
+ include/singa/utils/cuda_utils.h
+ src/core/tensor/distribution.cl
+ src/model/layer/im2col.cl
+ src/model/layer/pooling.cl
+ src/proto/caffe.proto
+ cmake/Thirdparty/FindViennaCL.cmake
+ cmake/Thirdparty/FindOpenCL.cmake
+ src/api/numpy.i
+ doc/en/docs/notebook/utils.py
+ examples/imagenet/inception/convert.py
+ tool/cpplint.py
+ travis*.log
+ .gitmodules
+ java/target/*
+ miniconda.sh
+
+ True
+
+
+
+
+
+
diff --git a/rat-excludes b/rat-excludes
deleted file mode 100644
index dd28d6229a..0000000000
--- 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 516b9a38c8..36e7e85442 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 e69de29bb2..ae0098691d 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 0000000000..df28f69031
--- /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=..