Skip to content

Commit

Permalink
ci: Add test report action.
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Jun 15, 2024
1 parent 6a334ba commit 3d31e47
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.0.0
- uses: actions/setup-dotnet@v4.0.0
with:
dotnet-version: 8.0.100
- run: dotnet build --configuration Release
- run: |
dotnet test --configuration Release --no-restore --no-build \
--logger "trx;LogFileName=$(PWD)/logs/test-results.trx"
--logger "trx;LogFileName=$PWD/logs/test-results.trx"
- uses: actions/upload-artifact@v4 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: $(PWD)/logs/test-results.trx
path: $PWD/logs/test-results.trx
20 changes: 20 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Test Report'
on:
workflow_run:
workflows: ['Build and Test'] # runs after CI workflow
types:
- completed
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1.9.1
with:
artifact: test-results # artifact name
name: XUnit Tests # Name of the check run which will be created
path: '*.trx' # Path to test results (inside artifact .zip)
reporter: dotnet-trx # Format of test results

0 comments on commit 3d31e47

Please sign in to comment.