Create test report #2055
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}) |