From f1fdfb94fd752dc7c0a3ad3da4461ccd8d3408ce Mon Sep 17 00:00:00 2001 From: indivar Date: Tue, 4 Jul 2023 23:15:26 +0530 Subject: [PATCH] add(751): add publish test result action followed steps specified in below mentioned link to do the setup https://github.com/EnricoMi/publish-unit-test-result-action/blob/v2.8.0/README.md#support-fork-repositories-and-dependabot-branches --- .github/workflows/ci.yml | 17 ++++++++++++++++ .github/workflows/test_reports.yml | 31 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/test_reports.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e260b3d..28c9c0e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,20 @@ jobs: with: recreate: true path: code-coverage-results.md + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: | + ./temp/testresults/test-results.xml + + event_file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} \ No newline at end of file diff --git a/.github/workflows/test_reports.yml b/.github/workflows/test_reports.yml new file mode 100644 index 00000000..f84a9272 --- /dev/null +++ b/.github/workflows/test_reports.yml @@ -0,0 +1,31 @@ +name: Test Reports + +on: + workflow_run: + workflows: ["CI"] + types: + - completed +permissions: {} + +jobs: + test_reports: + name: Test Reports + runs-on: ubuntu-latest + if: {{ github.event.workflow_run.conclusion != 'skipped' && github.event.event_name== 'pull_request' }} + permissions: + checks: write + pull-requests: write + actions: read + steps: + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 + 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: "artifacts/**/*.xml"