GitHub Action support is available in two different ways. There are some settings common to both:
--linecomments has github as a configured bug system (the default).The Apache Yetus community makes available a built-in action that may be executed as part of a standard GitHub Action workflow. The basic workflow file should look like this, changing [VERSION] to either be a released version (or main to use the bleeding edge, untested, and potentially unstable release):
--- name: Apache Yetus on: [push, pull_request] # yamllint disable-line rule:truthy jobs: build: runs-on: ubuntu-latest steps: - name: checkout uses: actions/checkout@v3 with: path: src fetch-depth: 0 - name: Apache Yetus test-patch uses: apache/yetus-test-patch-action@[VERSION] with: basedir: ./src patchdir: ./out buildtool: nobuild githubtoken: ${{ secrets.GITHUB_TOKEN }} - name: Artifact output if: ${{ always() }} uses: actions/upload-artifact@v3 with: name: apacheyetuspatchdir path: ${{ github.workspace }}/out
Currently, not all arguments and parameters that can be set on the test-patch command line are available to set via the workflow action. Options currently supported are:
| Option | Notes | Default | More Information |
|---|---|---|---|
| basedir | same as --basedir | NONE | Usage Introduction |
| blankseolignorefile | same as --blanks-eol-ignore-file | .yetus/blanks-eol.txt | blanks plug-in |
| blankstabsignorefile | same as --blanks-tabs-ignore-file | .yetus/blanks-tabs.txt | blanks plug-in |
| bufbasedir | same as --buf-basedir | . | buf plug-in |
| buildtool | same as --build-tool | nobuild | Build Tools |
| continuousimprovement | same as --continuous-improvement | false | Robots |
| excludes | same as --excludes | .yetus/excludes.txt | Usage Introduction |
| githubtoken | same as --github-token | NONE | GitHub plug-in |
| javahome | same as --java-home | /usr/lib/jvm/java-21-openjdk-amd64 | Java-related plug-ins |
| patchdir | same as --patch-dir | NONE | Usage Introduction |
| pip | same as --pylint-pip | pip3 | pylint plug-in |
| plugins | same as --plugins | all,-asflicense,-author,-findbugs,-gitlab,-jira,-shelldocs | Usage Introduction |
| project | same as --project | Auto-set based upon the repository name | Usage Introduction |
| pylint | same as --pylint | pylint3 | pylint plug-in |
| reapermode | same as --reapermode | kill | Advanced Usage |
| reviveconfig | same as --revive-config | .revive.toml | revive plug-in |
| testsfilter | same as --tests-filter | '' | Usage Introduction |
Items marked NONE MUST be provided in the workflow yaml file.
Some options are hard-coded to make test-patch easier to use:
| Argument | Value | More Information |
|---|---|---|
--brief-report-file | patchdir/brief.txt | briefreport plug-in |
--console-report-file | patchdir/console.txt | QBT |
--html-report-file | patchdir/report.html | htmlout plug-in |
--ignore-unknown-options | true | Usage Introduction |
--junit-report-xml | patchdir/junit-report.xml | junit plug-in |
--pylint-requirements | true | pylint plug-in |
--report-unknown-options | false | Usage Introduction |
Manual configuration is recommended if one needs significant customization over the test environment and test-patch flags.
TRIGGER: ${GITHUB_ACTIONS}=True
GitHub Actions support has only been tested on the ubuntu-latest image. It automatically configures --patch-dir to be ${GITHUB_WORKSAPCE}/yetus if not previously set.
When running under GitHub Actions, Apache Yetus automatically writes a summary of the test results to the Job Summary. This provides immediate visibility of pass/fail status and details directly on the workflow run page, without needing to download artifacts or parse log files.
The Job Summary includes:
This feature requires no configuration and is automatically enabled when the GITHUB_STEP_SUMMARY environment variable is present (which GitHub Actions sets automatically).
See also: