Skip to content

Commit ad92e4d

Browse files
authored
Print pretty test results (#2421)
1 parent 15c985b commit ad92e4d

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
build:
2222
name: Build - ${{ inputs.unity-version }}
2323
runs-on: ubuntu-22.04
24+
permissions:
25+
checks: write
26+
statuses: write
27+
contents: read
2428
steps:
2529
- name: Checkout
2630
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
@@ -134,15 +138,24 @@ jobs:
134138
docker exec unity dotnet msbuild /t:UnityConfigureSentryOptions /p:TestDsn= /p:Configuration=Release /p:OutDir=other src/Sentry.Unity
135139
docker exec unity dotnet msbuild /t:UnityPlayModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Tests
136140
141+
- name: Run Unity tests (editmode)
142+
run: docker exec unity dotnet msbuild /t:UnityEditModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Editor.Tests
143+
144+
- name: Publish Test Results
145+
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1
146+
if: ${{ !cancelled() }}
147+
with:
148+
name: Unity Test Results - ${{ env.UNITY_VERSION }}
149+
path: artifacts/test/**/*.xml
150+
reporter: dotnet-nunit
151+
fail-on-error: false
152+
137153
- name: Upload test artifacts (playmode)
138154
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
139155
with:
140156
name: Test results (playmode) - ${{ env.UNITY_VERSION }}
141157
path: artifacts/test/playmode
142158

143-
- name: Run Unity tests (editmode)
144-
run: docker exec unity dotnet msbuild /t:UnityEditModeTest /p:Configuration=Release /p:OutDir=other test/Sentry.Unity.Editor.Tests
145-
146159
- name: Upload test artifacts (editmode)
147160
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
148161
with:

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ jobs:
5252
build-unity-sdk:
5353
name: Build Unity SDK
5454
secrets: inherit
55+
permissions:
56+
checks: write
57+
statuses: write
58+
contents: read
5559
strategy:
5660
fail-fast: false
5761
matrix:

0 commit comments

Comments
 (0)