Skip to content

Commit

Permalink
Add test report job
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Coffman <[email protected]>
  • Loading branch information
StevenACoffman committed Jun 20, 2024
1 parent 033d818 commit 1cf53c2
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: test report
on:
workflow_run:
workflows: [build]
types: [completed]

permissions:
checks: write

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Download Test Report
uses: dawidd6/action-download-artifact@v6
with:
name: junit-test-results
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: '*.xml'
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ jobs:
cd _examples
go mod download
gotestsum --junitfile ../go_examples_report.xml --format-icons=hivis --format=pkgname-and-test-fails -- -race ./... -trimpath
- name: Upload Test Report
uses: actions/[email protected]
if: always() # always run even if the previous step fails
with:
name: junit-test-results
path: '*.xml'
retention-days: 1
- name: action-junit-report
shell: bash
if: success() || failure() # always run even if the previous step fails
Expand All @@ -63,7 +70,7 @@ jobs:
if: success() || failure() # always run even if the previous step fails
run: |
echo "### robherley/go-test-action! :rocket:" >> $GITHUB_STEP_SUMMARY
# - name: Annotate tests
# - name: Annotate tests does not work on pull-requests for security
# if: success() || failure() # always run even if the previous step fails
# uses: guyarb/[email protected]
# with:
Expand All @@ -76,6 +83,9 @@ jobs:
# Will always exit(0) on successful test file parse.
# Optional. No default
fromJSONFile: go_test.json
omit: |
untested
successful
- name: test-summary/action announcement
shell: bash
if: success() || failure() # always run even if the previous step fails
Expand All @@ -85,7 +95,7 @@ jobs:
uses: test-summary/[email protected]
if: success() || failure() # always run even if the previous step fails
with:
show: "fail, skip"
paths: |
report.xml
go_examples_report.xml
show: "fail, skip"

0 comments on commit 1cf53c2

Please sign in to comment.