Skip to content

Commit

Permalink
Test reporter doesnt support external PRS so need to split into two a…
Browse files Browse the repository at this point in the history
…ctions
  • Loading branch information
Matthew-Wise committed Mar 27, 2024
1 parent cae875b commit 0ec43d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ on:
branches:
- main

permissions:
id-token: write
contents: read
actions: read
checks: write

jobs:
build:
env:
Expand Down Expand Up @@ -55,16 +49,12 @@ jobs:

- name: Run tests
run: dotnet test $TESTPROJECT -c $BUILD_CONFIG --no-build --verbosity normal --filter "Category!=LongRunning" --logger "trx;LogFileName=test-results.trx"

- name: Test Report
uses: dorny/test-reporter@v1
if: always()
- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: DotNET Tests
path: "**/test-results.trx"
reporter: dotnet-trx
fail-on-error: true

name: test-results
path: test-results.trx

- name: Publish
if: github.event_name == 'release'
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
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'] # runs after Build workflow
types:
- completed
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: test-results # artifact name
name: .NET Tests # Name of the check run which will be created
path: "**/test-results.trx" # Path to test results (inside artifact .zip)
reporter: dotnet-trx

0 comments on commit 0ec43d8

Please sign in to comment.