Skip to content

Commit

Permalink
Only publish test results once
Browse files Browse the repository at this point in the history
This aggregates the reports of all matrix builds.
The build test results can still be distinguished by their unique reort
name
  • Loading branch information
kwin committed Jan 2, 2025
1 parent 7601ca4 commit e8dbecd
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ 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/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 +111,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"

0 comments on commit e8dbecd

Please sign in to comment.