From e7029ec861e77b1174c32387570703b0e8b4dabd Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 11 Jan 2024 23:30:14 -0800 Subject: [PATCH] Separate publishing of test results for PRs from forks --- .github/actions/test/action.yml | 8 +++----- .github/workflows/publish-test-results.yml | 24 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 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..5ede81264 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -79,10 +79,8 @@ runs: shell: bash run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger trx --results-directory "${{ env.RESULTS_NAME }}" - - name: Publish Test Results - if: ${{ !cancelled() }} - uses: phoenix-actions/test-reporting@v12 + - name: Upload Test Results + 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