.github/workflows: publish test results for failed job

The GitHub Actions Linux Testing only reports limited information (can not see full stacktrace, time consumed, or stderr from child threads) when unit tests fail. Adding a step to upload the test report to Artifacts if the test fails. If the test is successful, no artifacts will be uploaded.
This commit is contained in:
ZHANG Dapeng 2022-01-05 10:31:22 -08:00 committed by GitHub
parent 24e345c06d
commit 86b8b265ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -53,6 +53,13 @@ jobs:
- name: Build
run: buildscripts/kokoro/unix.sh
- name: Post Failure Upload Test Reports to Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Test Reports (JRE ${{ matrix.jre }})
path: ./*/build/reports/tests/**
retention-days: 14
- name: Check for modified codegen
run: test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false)