Skip to content

HBASE-29787 Run Yetus General Checks as a GitHub Action #12

HBASE-29787 Run Yetus General Checks as a GitHub Action

HBASE-29787 Run Yetus General Checks as a GitHub Action #12

# 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.
# yamllint disable rule:line-length
---
name: Yetus General Check
"on":
pull_request:
types: [opened, synchronize, reopened]
permissions:
checks: write
contents: read
pull-requests: write
statuses: write
jobs:
general-check:
runs-on: ubuntu-latest
timeout-minutes: 600
steps:
- name: Checkout HBase
uses: actions/checkout@v4
with:
path: src
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Maven cache
uses: actions/cache@v4
with:
path: ~/.m2
key: hbase-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
hbase-m2-
- name: Run Yetus Test Patch
run: |
mkdir -p "${{ github.workspace }}/out"
BASE=/github/workspace/src
docker run --rm \
-v "${{ github.workspace }}/src:${BASE}" \
-v "${{ github.workspace }}/out:/out" \
-e GITHUB_ACTIONS=true \
-e GITHUB_EVENT_NAME="${{ github.event_name }}" \
-e GITHUB_BASE_REF="${{ github.base_ref }}" \
-e GITHUB_HEAD_REF="${{ github.head_ref }}" \
-e GITHUB_REF="${{ github.ref }}" \
-e GITHUB_REPOSITORY="${{ github.repository }}" \
-e GITHUB_RUN_NUMBER="${{ github.run_number }}" \
-e GITHUB_RUN_ID="${{ github.run_id }}" \
-e GITHUB_SHA="${{ github.sha }}" \
-e GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
-e GITHUB_WORKSPACE=/github/workspace \
ghcr.io/apache/yetus:main \
test-patch \
--basedir=${BASE} \
--patch-dir=/out \
--build-tool=maven \
--project=hbase \
--personality=${BASE}/dev-support/hbase-personality.sh \
--github-token="${{ secrets.GITHUB_TOKEN }}" \
--java-home=/usr/lib/jvm/temurin-17-jdk-amd64 \
--plugins=all,-javadoc,-jira,-shadedjars,-unit,-findbugs \
--tests-filter=checkstyle,javac,javadoc,pylint,shellcheck,shelldocs,blanks,perlcritic,ruby-lint,rubocop \
--blanks-eol-ignore-file=${BASE}/dev-support/blanks-eol-ignore.txt \
--blanks-tabs-ignore-file=${BASE}/dev-support/blanks-tabs-ignore.txt \
--quick-hadoopcheck \
--skip-dirs=dev-support \
--brief-report-file=/out/brief.txt \
--console-report-file=/out/console.txt \
--html-report-file=/out/report.html \
--junit-report-xml=/out/junit-report.xml
- name: Publish Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: yetus-general-check-output
path: ${{ github.workspace }}/out
retention-days: 7