YETUS-992. Create and publish a github action
diff --git a/.github/workflows/yetus.yml b/.github/workflows/yetus.yml
new file mode 100644
index 0000000..6d76681
--- /dev/null
+++ b/.github/workflows/yetus.yml
@@ -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.
+
+---
+name: Apache Yetus
+
+on: [push, pull_request] # yamllint disable-line rule:truthy
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v2
+ with:
+ path: src
+ fetch-depth: 0
+ - name: test-patch
+ uses: ./src
+ with:
+ basedir: ./src
+ patchdir: ./out
+ buildtool: nobuild
+ githubtoken: ${{ secrets.GITHUB_TOKEN }}
+ - name: Artifact output
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: apacheyetuspatchdir
+ path: ${{ github.workspace }}/out
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..416466c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,54 @@
+<!--
+ 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.
+-->
+
+# Apache Yetus test-patch
+
+This action enables Apache Yetus' change testing facilities via GitHub actions
+without significant configuration. To use it, add the following work flow:
+
+```yaml
+---
+name: Apache Yetus
+
+on: [push, pull_request] # yamllint disable-line rule:truthy
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v2
+ with:
+ path: src
+ fetch-depth: 0
+ - name: Apache Yetus test-patch
+ uses: apache/yetus-test-patch-action@v1
+ with:
+ basedir: ./src
+ patchdir: ./out
+ buildtool: nobuild
+ - name: Artifact output
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: apacheyetuspatchdir
+ path: ${{ github.workspace }}/out
+```
+
+For more information, see the [Apache Yetus Website](https://yetus.apache.org).
diff --git a/action.yml b/action.yml
new file mode 100644
index 0000000..d15a8d6
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,78 @@
+# 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: 'test-patch'
+author: 'Apache Software Foundation'
+description: 'Apache Yetus precommit patch testing'
+branding:
+ color: purple
+ icon: feather
+inputs:
+ basedir:
+ description: 'Directory location of source'
+ required: true
+ default: "${GITHUB_WORKSPACE}"
+ continuousimprovement:
+ description: 'Pass branches that would otherwise fail'
+ default: false
+ patchdir:
+ description: 'Directory location of logs, temp space, etc'
+ required: true
+ default: "/tmp/yetus"
+ githubtoken:
+ description: 'GitHub token to use'
+ required: true
+ default: ''
+ buildtool:
+ description: 'Name of build tool plug-in to use'
+ default: "nobuild"
+ excludes:
+ description: 'Filename of files/directories to ignore'
+ default: '.yetus-excludes.txt'
+ javahome:
+ description: 'Location of the JDK to use'
+ default: '/usr/lib/jvm/java-11-openjdk-amd64'
+ plugins:
+ description: 'Fine grained control over plug-ins'
+ default: all,-asflicense,-author,-findbugs,-gitlabcilint,-shelldocs
+ pylint:
+ description: 'Major Python version to use for pylint: pylint2 or pylint3'
+ default: pylint3
+ pip:
+ description: 'Major Python version to use for pip: pip2 or pip3'
+ default: pip3
+ reapermode:
+ description: 'How to handle stale surefire tests'
+ default: kill
+runs:
+ using: 'docker'
+ image: apache/yetus:main
+ args:
+ - test-patch
+ - --basedir=${{ inputs.basedir }}
+ - --brief-report-file=${{ inputs.patchdir }}/brief.txt
+ - --build-tool=${{ inputs.buildtool }}
+ - --console-report-file=${{ inputs.patchdir }}/console.txt
+ - --continuous-improvement=${{ inputs.continuousimprovement }}
+ - --excludes=${{ inputs.excludes }}
+ - --github-token=${{ inputs.githubtoken }}
+ - --html-report-file=${{ inputs.patchdir }}/report.html
+ - --junit-report-xml=${{ inputs.patchdir }}/junit-report.xml
+ - --patch-dir=${{ inputs.patchdir }}
+ - --plugins=${{ inputs.plugins }}
+ - --pylint-pip-cmd=${{ inputs.pip }}
+ - --pylint-requirements=true
+ - --pylint=${{ inputs.pylint }}
+ - --reapermode=${{ inputs.reapermode }}