Add a build step that uploads surefire test reports

Motivation:
When a build fails, the number one priority is figuring out why.
Having surefire test reports readily available on the Github Actions page will make this easier.

Modification:
Add a build step that uploads surefire test reports and attaches them as a check to the PR.

Result:
Easier to diagnose test failures on PRs.
This commit is contained in:
Chris Vest 2021-04-14 12:11:14 +02:00
parent e7f7335804
commit 4ddd194b91
1 changed files with 9 additions and 2 deletions

View File

@ -43,8 +43,15 @@ jobs:
# Run the make script
- name: Make build
run: make build
- uses: actions/upload-artifact@v2
- name: Publish Test Report
uses: scacap/action-surefire-report@v1.0.7
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/target/surefire-reports/TEST-*.xml'
commit: ${{ github.event.workflow_run.head_commit.id }}
check_name: Build test reports
- name: Upload build artefacts
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: target