Skip to content

Publish test results #12

Publish test results

Publish test results #12

Workflow file for this run

name: Publish test results
on:
workflow_run:
workflows: ["Wokwi tests"]
types:
- completed
# No permissions by default
permissions: { contents: read }
jobs:
unit-test-results:
name: Unit Test Results
if: |
github.event.workflow_run.conclusion == 'success' ||
github.event.workflow_run.conclusion == 'failure' ||
github.event.workflow_run.conclusion == 'timed_out'
runs-on: ubuntu-latest
permissions:
actions: read
checks: write
pull-requests: write
steps:
- name: Print info
run: |
echo "Event: ${{ github.event.workflow_run.event }}"
echo "Conclusion: ${{ github.event.workflow_run.conclusion }}"
echo "Status: ${{ github.event.workflow_run.status }}"
echo "Head SHA: ${{ github.event.workflow_run.head_sha }}"
echo "Parent Run ID: ${{ github.event.workflow_run.id }}"
echo "Run Number: ${{ github.run_number }}"
echo "Run ID: ${{ github.run_id }}"
echo "Ref: ${{ github.ref }}"
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: tests.yml
commit: ${{ github.event.workflow_run.head_sha }}
path: ./artifacts
allow_forks: true
- name: Download and Extract Wokwi Results
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
path: ./artifacts
- name: List files
run: |
ls -R ./artifacts
- name: Publish Unit 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