|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +# yamllint disable rule:line-length |
| 19 | +--- |
| 20 | +name: Yetus General Check |
| 21 | + |
| 22 | +"on": |
| 23 | + pull_request: |
| 24 | + types: [opened, synchronize, reopened] |
| 25 | + |
| 26 | +permissions: {} |
| 27 | + |
| 28 | +jobs: |
| 29 | + general-check: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + timeout-minutes: 600 |
| 32 | + permissions: |
| 33 | + contents: read |
| 34 | + statuses: write |
| 35 | + |
| 36 | + env: |
| 37 | + YETUS_VERSION: '0.15.0' |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: Checkout HBase |
| 41 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 42 | + with: |
| 43 | + path: src |
| 44 | + fetch-depth: 0 |
| 45 | + persist-credentials: false |
| 46 | + |
| 47 | + - name: Set up JDK 17 |
| 48 | + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 |
| 49 | + with: |
| 50 | + java-version: '17' |
| 51 | + distribution: 'temurin' |
| 52 | + |
| 53 | + - name: Maven cache |
| 54 | + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 |
| 55 | + with: |
| 56 | + path: ~/.m2 |
| 57 | + key: hbase-m2-${{ hashFiles('**/pom.xml') }} |
| 58 | + restore-keys: | |
| 59 | + hbase-m2- |
| 60 | +
|
| 61 | + - name: Download Yetus |
| 62 | + run: | |
| 63 | + mkdir -p yetus |
| 64 | + cd yetus |
| 65 | + bash "${{ github.workspace }}/src/dev-support/jenkins-scripts/cache-apache-project-artifact.sh" \ |
| 66 | + --keys 'https://downloads.apache.org/yetus/KEYS' \ |
| 67 | + --verify-tar-gz \ |
| 68 | + ./apache-yetus-${{ env.YETUS_VERSION }}-bin.tar.gz \ |
| 69 | + yetus/${{ env.YETUS_VERSION }}/apache-yetus-${{ env.YETUS_VERSION }}-bin.tar.gz |
| 70 | + tar --strip-components=1 -xzf apache-yetus-${{ env.YETUS_VERSION }}-bin.tar.gz |
| 71 | + rm apache-yetus-${{ env.YETUS_VERSION }}-bin.tar.gz |
| 72 | +
|
| 73 | + - name: Run Yetus General Check |
| 74 | + env: |
| 75 | + ARCHIVE_PATTERN_LIST: "TEST-*.xml,org.apache.h*.txt,*.dumpstream,*.dump" |
| 76 | + DOCKERFILE: "${{ github.workspace }}/src/dev-support/docker/Dockerfile" |
| 77 | + GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }} |
| 78 | + GITHUB_USER: ${{ github.actor }} |
| 79 | + PATCHDIR: "${{ github.workspace }}/yetus-general-check/output" |
| 80 | + PLUGINS: "all,-javadoc,-jira,-shadedjars,-unit" |
| 81 | + SET_JAVA_HOME: "/usr/lib/jvm/java-17" |
| 82 | + SOURCEDIR: "${{ github.workspace }}/src" |
| 83 | + TESTS_FILTER: "checkstyle,javac,pylint,shellcheck,shelldocs,blanks,perlcritic,ruby-lint,rubocop" |
| 84 | + YETUSDIR: "${{ github.workspace }}/yetus" |
| 85 | + AUTHOR_IGNORE_LIST: "src/main/asciidoc/_chapters/developer.adoc" |
| 86 | + BLANKS_EOL_IGNORE_FILE: "dev-support/blanks-eol-ignore.txt" |
| 87 | + BLANKS_TABS_IGNORE_FILE: "dev-support/blanks-tabs-ignore.txt" |
| 88 | + EXCLUDE_TESTS_URL: "https://ci-hbase.apache.org/job/HBase-Find-Flaky-Tests/job/${{ github.base_ref }}/lastSuccessfulBuild/artifact/output/excludes" |
| 89 | + BUILD_THREAD: "4" |
| 90 | + SUREFIRE_FIRST_PART_FORK_COUNT: "1.0C" |
| 91 | + SUREFIRE_SECOND_PART_FORK_COUNT: "0.5C" |
| 92 | + BRANCH_NAME: "${{ github.base_ref }}" |
| 93 | + DEBUG: 'true' |
| 94 | + run: | |
| 95 | + cd "${{ github.workspace }}" |
| 96 | + bash src/dev-support/jenkins_precommit_github_yetus.sh |
| 97 | +
|
| 98 | + - name: Publish Job Summary |
| 99 | + if: always() |
| 100 | + run: | |
| 101 | + cd "${{ github.workspace }}" |
| 102 | + python3 src/dev-support/yetus_console_to_md.py yetus-general-check/output >> $GITHUB_STEP_SUMMARY |
| 103 | +
|
| 104 | + - name: Publish Test Results |
| 105 | + if: always() |
| 106 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 107 | + with: |
| 108 | + name: yetus-general-check-output |
| 109 | + path: ${{ github.workspace }}/yetus-general-check/output |
| 110 | + retention-days: 7 |
| 111 | + |
| 112 | + zizmor: |
| 113 | + runs-on: ubuntu-latest |
| 114 | + timeout-minutes: 5 |
| 115 | + permissions: |
| 116 | + contents: read |
| 117 | + |
| 118 | + steps: |
| 119 | + - name: Check for workflow changes |
| 120 | + id: changes |
| 121 | + env: |
| 122 | + GH_TOKEN: ${{ github.token }} |
| 123 | + run: | |
| 124 | + if gh pr diff "${{ github.event.pull_request.number }}" --repo "${{ github.repository }}" --name-only | grep -q '^\.github/workflows/'; then |
| 125 | + echo "changed=true" >> "$GITHUB_OUTPUT" |
| 126 | + else |
| 127 | + echo "changed=false" >> "$GITHUB_OUTPUT" |
| 128 | + fi |
| 129 | +
|
| 130 | + - name: Checkout HBase |
| 131 | + if: steps.changes.outputs.changed == 'true' |
| 132 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 133 | + with: |
| 134 | + persist-credentials: false |
| 135 | + |
| 136 | + - name: Run zizmor |
| 137 | + if: steps.changes.outputs.changed == 'true' |
| 138 | + run: pipx run zizmor --min-severity=medium .github/workflows/ |
0 commit comments