Skip to content

Commit

Permalink
Update to use EnricoMi/publish-unit-test-result-action
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenfuqua committed Mar 7, 2024
1 parent d657f6b commit 8fb0770
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 19 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/after-pullrequest-bidi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
29 changes: 22 additions & 7 deletions .github/workflows/after-pullrequest-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 13 additions & 3 deletions .github/workflows/on-pullrequest-bidi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
14 changes: 12 additions & 2 deletions .github/workflows/on-pullrequest-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 8fb0770

Please sign in to comment.