From 02e051580c18a5a006201c3ab117de9a27cfa418 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 12 Jan 2024 08:56:45 -0800 Subject: [PATCH] Separate publishing of test results for PRs from forks --- .github/actions/test/action.yml | 7 +++---- .github/workflows/publish-test-results.yml | 24 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish-test-results.yml diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 8cab83ae9..d36b8b97f 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -79,10 +79,9 @@ runs: shell: bash run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger trx --results-directory "${{ env.RESULTS_NAME }}" - - name: Publish Test Results + - name: Upload Test Results if: ${{ !cancelled() }} - uses: phoenix-actions/test-reporting@v12 + uses: actions/upload-artifact@v4 with: - name: ${{ env.RESULTS_NAME }} + name: results-${{ env.RESULTS_NAME }} path: ${{ env.RESULTS_NAME }}/*.trx - reporter: dotnet-trx diff --git a/.github/workflows/publish-test-results.yml b/.github/workflows/publish-test-results.yml new file mode 100644 index 000000000..843a13517 --- /dev/null +++ b/.github/workflows/publish-test-results.yml @@ -0,0 +1,24 @@ +name: Publish Test Results + +on: + workflow_run: + workflows: ['Build'] + types: + - completed + +permissions: + contents: read + actions: read + checks: write + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Publish Test Results + uses: phoenix-actions/test-reporting@v12 + with: + artifact: /results-(.*)/ + name: '$1' + path: '*.trx' + reporter: dotnet-trx