Repository navigation
HDDS-17509. Replace reusable check.yml workflow with an action #11946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
adoroszlai
wants to merge
19
commits into
apache:master
Choose a base branch
from
adoroszlai:HDDS-17509
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0930ad7
create check action
adoroszlai 329dacb
use check action for build
adoroszlai 48bbb75
use check action for compile
adoroszlai b07a8bc
use check action for basic
adoroszlai 51e4480
use check action for errorprone
adoroszlai ba7a83c
use check action for dependency
adoroszlai a027d44
use check action for license
adoroszlai cfece13
use check action for javadoc
adoroszlai bc2ce83
use check action for repro
adoroszlai 845d77d
use check action for acceptance
adoroszlai f1d82cb
use check action for compat-old
adoroszlai a55e7ec
use check action for kubernetes
adoroszlai b8dfe18
use check action for integration
adoroszlai d8e566a
use check action for junit
adoroszlai f6485a9
use check action for specific-tests
adoroszlai 4f2d028
fixup for add action
adoroszlai 7bec3c9
fixup for add action
adoroszlai e3a4b73
fixup for acceptance
adoroszlai bfea43c
remove check workflow
adoroszlai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,190 @@ | ||
| # 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. | ||
|
|
||
| # Executes a single check from `hadoop-ozone/dev-support/checks/`. | ||
| # Before and after the check, it performs various steps based on inputs. | ||
|
|
||
| name: check | ||
|
|
||
| inputs: | ||
| # REQUIRED | ||
| script: | ||
| required: true | ||
| description: "Test script to run from hadoop-ozone/dev-support/checks, without .sh extension" | ||
|
|
||
| # OPTIONAL (ordered alphabetically) | ||
| checkout-fetch-depth: | ||
| description: "Fetch depth for checking out the repo (default: no history)" | ||
| default: 1 | ||
|
|
||
| java-version: | ||
| description: "Java version to set up (default: none)" | ||
| default: '' | ||
|
|
||
| needs-maven-cache: | ||
| description: "Whether to restore Maven cache before run (default: yes)" | ||
| default: true | ||
|
|
||
| needs-npm-cache: | ||
| description: "Whether to restore NPM cache before run (default: no)" | ||
| default: false | ||
|
|
||
| needs-ozone-binary-tarball: | ||
| description: "Whether to download Ozone binary tarball created by build (default: no)" | ||
| default: false | ||
|
|
||
| needs-ozone-repo: | ||
| description: "Whether to download Ozone jars created by build (default: no)" | ||
| default: false | ||
|
|
||
| needs-ozone-source-tarball: | ||
| description: "Whether to download Ozone source tarball created by build (default: no)" | ||
| default: false | ||
|
|
||
| ratis-args: | ||
| description: "Version overrides from custom Ratis build (default: none)" | ||
| default: '' | ||
|
|
||
| script-args: | ||
| description: "Arguments for the test script, ratis-args are appended" | ||
| default: '' | ||
|
|
||
| split: | ||
| description: "Name of split for matrix jobs, only used in display name" | ||
| default: '' | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Checkout project | ||
| if: ${{ inputs.needs-ozone-source-tarball != 'true' }} | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| persist-credentials: false | ||
| ref: ${{ env.SHA }} | ||
| fetch-depth: ${{ inputs.checkout-fetch-depth }} | ||
|
|
||
| - name: Delete .git to omit commit SHA in build artifacts | ||
| if: ${{ inputs.needs-ozone-source-tarball != 'true' && inputs.checkout-fetch-depth == '1' }} | ||
| shell: bash | ||
| run: | | ||
| rm -fr .git | ||
|
|
||
| - name: Download Ozone source tarball | ||
| if: ${{ inputs.needs-ozone-source-tarball == 'true' }} | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: ozone-src | ||
|
|
||
| - name: Extract source tarball | ||
| if: ${{ inputs.needs-ozone-source-tarball == 'true' }} | ||
| shell: bash | ||
| run: | | ||
| tar --strip-components 1 -xzvf ozone*-src.tar.gz | ||
|
|
||
| - name: Cache for NPM dependencies | ||
| if: ${{ inputs.needs-npm-cache == 'true' }} | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: | | ||
| ~/.pnpm-store | ||
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pnpm- | ||
|
|
||
| - name: Cache for Maven dependencies | ||
| if: ${{ inputs.needs-maven-cache == 'true' }} | ||
| uses: actions/cache/restore@v6 | ||
| with: | ||
| path: | | ||
| ~/.m2/repository/*/*/* | ||
| !~/.m2/repository/org/apache/ozone | ||
| key: maven-repo-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| maven-repo- | ||
|
|
||
| - name: Download Ozone repo | ||
| id: download-ozone-repo | ||
| if: ${{ inputs.needs-ozone-repo == 'true' }} | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: ozone-repo | ||
| path: | | ||
| ~/.m2/repository/org/apache/ozone | ||
|
|
||
| - name: Download Ratis repo | ||
| if: ${{ inputs.ratis-args != '' }} | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: ratis-jars | ||
| path: | | ||
| ~/.m2/repository/org/apache/ratis | ||
|
|
||
| - name: Download Ozone binary tarball | ||
| if: ${{ inputs.needs-ozone-binary-tarball == 'true' }} | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: ozone-bin | ||
|
|
||
| - name: Extract binary tarball | ||
| if: ${{ inputs.needs-ozone-binary-tarball == 'true' }} | ||
| shell: bash | ||
| run: | | ||
| mkdir -p hadoop-ozone/dist/target | ||
| tar xzvf ozone*.tar.gz -C hadoop-ozone/dist/target | ||
| rm ozone*.tar.gz | ||
|
|
||
| - name: Setup java ${{ inputs.java-version }} | ||
| if: ${{ inputs.java-version != '' }} | ||
| uses: actions/setup-java@v6 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: ${{ inputs.java-version }} | ||
|
|
||
| - name: Execute tests | ||
| shell: bash | ||
| run: | | ||
| $COMMAND | ||
| env: | ||
| COMMAND: hadoop-ozone/dev-support/checks/${{ inputs.script }}.sh ${{ inputs.script-args }} ${{ inputs.ratis-args }} | ||
|
|
||
| - name: Summary of failures | ||
| if: ${{ failure() }} | ||
| shell: bash | ||
| run: | | ||
| if [[ -s "target/$SCRIPT/summary.md" ]]; then | ||
| cat target/$SCRIPT/summary.md >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
| hadoop-ozone/dev-support/checks/_summary.sh target/$SCRIPT/summary.txt | ||
| env: | ||
| SCRIPT: ${{ inputs.script }} | ||
|
|
||
| - name: Archive build results | ||
| id: archive | ||
| if: ${{ !cancelled() }} | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: ${{ (inputs.split && format('{0}-{1}', inputs.script, inputs.split)) || inputs.script }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed in the CI run that Should we keep the name sanitizing from the old Calculate artifact name step?
|
||
| # please keep path as a single item; move to that directory all files needed in the artifact | ||
| path: target/${{ inputs.script }} | ||
| continue-on-error: true | ||
|
|
||
| - name: Test summary | ||
| if: ${{ !cancelled() }} | ||
| continue-on-error: true | ||
| shell: bash | ||
| run: python3 dev-support/ci/junit_summary.py >> "$GITHUB_STEP_SUMMARY" | ||
| env: | ||
| JUNIT_REPORT_URL: ${{ steps.archive.outputs.artifact-url }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set SHA from
needs.build-info.outputs.shasomewhere? I couldn't find it defined.