From 8ab202ebd1d78b80cc7802f23d863b08cc297cd9 Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Fri, 18 Apr 2025 11:09:24 +0200 Subject: [PATCH] Investigate missing test-result reports Test results are not published properly due to an "There is no pull request for commit <...>" error, indicating a problem with visibility and or accessability... --- .github/workflows/maven.yaml | 19 ++++++++++++++----- .github/workflows/unit-tests.yml | 7 ++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index ba6336bbc..158316725 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -22,29 +22,38 @@ jobs: name: OS ${{ matrix.os }} Java ${{ matrix.java }} compile timeout-minutes: 90 steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - name: Set up JDK 17/21 - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 + uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 with: distribution: 'temurin' # See 'Supported distributions' for available options java-version: ${{ matrix.java }} cache: 'maven' - name: Set up Maven - uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 + uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5 with: maven-version: 3.9.2 - name: Build with Maven - uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 + uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1.0.1 with: run: >- mvn -V -B -fae -ntp clean verify - name: Upload Test Results for Java-${{ matrix.java }} - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() with: name: test-results-${{ matrix.os }}-java${{ matrix.java }} if-no-files-found: error path: | ${{ github.workspace }}/**/target/surefire-reports/*.xml + event_file: + name: "Upload Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: Event File + path: ${{ github.event_path }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index baa1d0cc1..902b5c3cb 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -15,6 +15,9 @@ jobs: permissions: checks: write pull-requests: write + contents: read + issues: read + actions: read steps: - name: Download and Extract Artifacts @@ -33,9 +36,11 @@ jobs: done - name: Publish Unit Test Results - uses: EnricoMi/publish-unit-test-result-action@afb2984f4d89672b2f9d9c13ae23d53779671984 + uses: EnricoMi/publish-unit-test-result-action@afb2984f4d89672b2f9d9c13ae23d53779671984 # v2.19.0 with: commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} files: "artifacts/**/*.xml"