From 8fb077020fa88712c045ced2d2df62b714cbde69 Mon Sep 17 00:00:00 2001 From: "Stephen A. Fuqua" Date: Thu, 7 Mar 2024 09:58:47 -0600 Subject: [PATCH] Update to use EnricoMi/publish-unit-test-result-action --- .github/workflows/after-pullrequest-bidi.yml | 29 ++++++++++++++----- .../after-pullrequest-powershell.yml | 29 ++++++++++++++----- .github/workflows/on-pullrequest-bidi.yml | 16 ++++++++-- .../workflows/on-pullrequest-powershell.yml | 14 +++++++-- 4 files changed, 69 insertions(+), 19 deletions(-) diff --git a/.github/workflows/after-pullrequest-bidi.yml b/.github/workflows/after-pullrequest-bidi.yml index dae9fdc..691c2e7 100644 --- a/.github/workflows/after-pullrequest-bidi.yml +++ b/.github/workflows/after-pullrequest-bidi.yml @@ -13,13 +13,28 @@ on: jobs: report-test-results: + name: Report Test Results runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion != 'skipped' + + permissions: + checks: write + pull-requests: write + actions: read + # Uncomment the next two lines when using in a private repository + # contents: read + # issues: read steps: - - name: Upload Test Results - uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@71072fbb1229e1317f1a8de6b04206afb461bd67 # v3.1.2" + with: + run_id: ${{ github.event.workflow_run.id }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@f355d34d53ad4e7f506f699478db2dd71da9de5f # v2.15.1 with: - artifact: bidi-test-results - name: Bidi Tests Results - path: "junit.xml" - reporter: java-junit - fail-on-error: false + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/junit.xml" diff --git a/.github/workflows/after-pullrequest-powershell.yml b/.github/workflows/after-pullrequest-powershell.yml index 58e8b97..2755c26 100644 --- a/.github/workflows/after-pullrequest-powershell.yml +++ b/.github/workflows/after-pullrequest-powershell.yml @@ -13,13 +13,28 @@ on: jobs: report-test-results: + name: Report Test Results runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion != 'skipped' + + permissions: + checks: write + pull-requests: write + actions: read + # Uncomment the next two lines when using in a private repository + # contents: read + # issues: read steps: - - name: Upload Test Results - uses: dorny/test-reporter@eaa763f6ffc21c7a37837f56cd5f9737f27fc6c8 # v1.8.0 + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@71072fbb1229e1317f1a8de6b04206afb461bd67 # v3.1.2" + with: + run_id: ${{ github.event.workflow_run.id }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@f355d34d53ad4e7f506f699478db2dd71da9de5f # v2.15.1 with: - artifact: powershell-analyzer-test-results - name: Tests Results - path: "ps-analyzer.xml" - reporter: java-junit - fail-on-error: false + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/ps-analyzer.xml" diff --git a/.github/workflows/on-pullrequest-bidi.yml b/.github/workflows/on-pullrequest-bidi.yml index a37c2ee..38e343a 100644 --- a/.github/workflows/on-pullrequest-bidi.yml +++ b/.github/workflows/on-pullrequest-bidi.yml @@ -45,12 +45,12 @@ jobs: - name: Run tests run: npm run test:ci - - name: Upload test results + - name: Upload Test Results + if: always() uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: - name: bidi-test-results + name: Test Results path: ./bidi-scanner/cli/junit.xml - retention-days: 1 lint-lib: runs-on: ubuntu-latest @@ -99,3 +99,13 @@ jobs: - name: Run build # Does not save the results - just confirm that the build succeeds run: npm run build + + event_file: + name: Upload Event File + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + with: + name: Event File + path: ${{ github.event_path }} diff --git a/.github/workflows/on-pullrequest-powershell.yml b/.github/workflows/on-pullrequest-powershell.yml index ba4d93c..7a8c3dc 100644 --- a/.github/workflows/on-pullrequest-powershell.yml +++ b/.github/workflows/on-pullrequest-powershell.yml @@ -38,8 +38,18 @@ jobs: Invoke-Pester -Configuration $PesterConfig - name: Upload Test Results + if: always() uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: - name: powershell-analyzer-test-results + name: Test Results path: powershell-analyzer/ps-analyzer.xml - retention-days: 5 + + event_file: + name: Upload Event File + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + with: + name: Event File + path: ${{ github.event_path }}