From 1cf53c25422c64d7f016a1f10897d850ada253d5 Mon Sep 17 00:00:00 2001 From: Steve Coffman Date: Thu, 20 Jun 2024 13:26:52 -0400 Subject: [PATCH] Add test report job Signed-off-by: Steve Coffman --- .github/workflows/report.yml | 24 ++++++++++++++++++++++++ .github/workflows/test.yml | 14 ++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/report.yml diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml new file mode 100644 index 00000000000..df46c590b47 --- /dev/null +++ b/.github/workflows/report.yml @@ -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' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 833c9c7d3b3..c06b184ac22 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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/upload-artifact@v4.3.3 + 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 @@ -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/golang-test-annotations@v0.8.0 # with: @@ -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 @@ -85,7 +95,7 @@ jobs: uses: test-summary/action@v2.3 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"