Skip to content

Commit

Permalink
🧹 fix test reporting (#3087)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
  • Loading branch information
imilchev authored Jan 22, 2024
1 parent 89abd49 commit 167c1f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/pr-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ jobs:
with:
name: test-results
path: report.xml

event_file:
name: "Store event file"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}

license-check:
runs-on: ubuntu-latest
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ on:
jobs:
report:
permissions:
actions: read # Required to read the artifact
contents: read # Required to read the source
checks: write # Required to write the results
actions: read # Required to read the artifact
contents: read # Required to read the source
checks: write # Required to write the results
pull-requests: write # Required to write comments
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@v3
with:
artifact: test-results
name: Report test results
path: '*.xml' # Path to test results (inside artifact .zip)
reporter: java-junit # Format of test results
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Store event file/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"

0 comments on commit 167c1f7

Please sign in to comment.