Skip to content

Commit

Permalink
githubactions: add action-junit-report
Browse files Browse the repository at this point in the history
  • Loading branch information
privat committed Jul 9, 2024
1 parent c6da467 commit 6bf378a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ jobs:
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify
- uses: actions/upload-artifact@v4
if: success() || failure() # always run even if the previous step fails
with:
name: junit-test-results
path: target/surefire-reports/
- run: mkdir staging && cp target/*.jar staging
- uses: actions/upload-artifact@v4
with:
name: Package
path: staging
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}
34 changes: 34 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test Results
on:
workflow_run:
workflows: ["maven"]
types:
- completed
permissions: {}
jobs:
test-results:
name: Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

permissions:
checks: write
# needed unless run with comment_mode: off
pull-requests: write
# required by download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
with:
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/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "**/*.xml"

0 comments on commit 6bf378a

Please sign in to comment.