Skip to content
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

Only publish test results once #3500

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,16 @@ jobs:
- name: ${{ matrix.namePrefix }} Build with Maven ${{ env.STEP_NAME_SUFFIX }}
run: mvn -e -B -V ${{ env.MVN_GOAL }} ${{ env.MVN_ADDITIONAL_OPTS }}

- name: Publish Test Report
if: ${{ always() }} # make sure to run even if previous Maven execution failed (due to failed test)
uses: scacap/action-surefire-report@v1
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
check_name: Test report (${{ matrix.os }}, JDK ${{ matrix.jdk }})
name: Test Results (${{ matrix.os }}, JDK ${{ matrix.jdk }}))
path: |
target/surefire-reports/TEST*.xml
target/failsafe-reports/TEST*.xml
target/invoker-reports/TEST*.xml
target/it/**/build.log

# https://about.codecov.io/blog/javascript-code-coverage-using-github-actions-and-codecov/
- name: Upload code coverage to CodeCov (Main build)
Expand All @@ -107,3 +112,31 @@ jobs:
with:
changeLogPath: 'CHANGELOG.md'
skipLabels: 'Skip-Changelog,skip-changelog'

publish-test-results:
name: "Publish Tests Results"
needs: build
runs-on: ubuntu-latest
permissions:
checks: write

# only needed unless run with comment_mode: off
pull-requests: write

# only needed for private repository
contents: read

# only needed for private repository
issues: read
if: always()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "artifacts/**/*.xml"
Loading