Skip to content

Create test report #2056

Create test report

Create test report #2056

name: Create test report
on:
workflow_run:
workflows: ['Build & test']
types:
- completed
jobs:
report:
name: Create test report
runs-on: ubuntu-latest
steps:
- name: Create test report
id: test-reporter
uses: dorny/test-reporter@v1
with:
artifact: test-results
name: xUnit tests
path: '**/test-results.trx'
reporter: dotnet-trx
fail-on-error: false
- name: Send webhook
if: ${{ github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.event == 'schedule' }}
uses: sarisia/actions-status-discord@v1
with:
webhook: https://discordapp.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }}
status: ${{ github.event.workflow_run.conclusion || 'success' }}
description: |
**Test summary**
✔️ Passed: ${{ steps.test-reporter.outputs.passed }}
❌ Failed: ${{ steps.test-reporter.outputs.failed }}
⚠️ Skipped: ${{ steps.test-reporter.outputs.skipped }}
[Test report](${{ github.event.workflow_run.html_url }})
- name: Send fallback webhook
if: failure()
uses: sarisia/actions-status-discord@v1
with:
webhook: https://discordapp.com/api/webhooks/${{ secrets.WEBHOOK_ID }}/${{ secrets.WEBHOOK_TOKEN }}
description: |
**Test report creation failed for unknown reason**
[Test report](${{ github.event.workflow_run.html_url }})