Skip to content

Commit 8b4bd1f

Browse files
authored
Merge pull request #26 from IvanMurzak/copilot/add-github-action-tests-output
Add test result publishing to GitHub Actions workflows
2 parents c2ee1c9 + b9930ee commit 8b4bd1f

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
pull_request:
55
branches: [ "main" ]
66

7+
permissions:
8+
contents: read
9+
checks: write
10+
pull-requests: write
11+
712
jobs:
813
build-and-test:
914
runs-on: ${{ matrix.os }}
@@ -22,4 +27,11 @@ jobs:
2227
- name: Build
2328
run: dotnet build --no-restore --configuration Release
2429
- name: Test
25-
run: dotnet test --no-build --verbosity normal --configuration Release
30+
run: dotnet test --no-build --verbosity normal --configuration Release --logger trx
31+
- name: Publish Test Results
32+
uses: EnricoMi/publish-unit-test-result-action@v2
33+
if: always()
34+
with:
35+
files: '**/TestResults/*.trx'
36+
check_name: 'Test Results'
37+
large_files: true

.github/workflows/release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
branches: [ "main" ]
66

7+
permissions:
8+
contents: write
9+
checks: write
10+
pull-requests: write
11+
712
jobs:
813
check-version-tag:
914
runs-on: ubuntu-latest
@@ -68,7 +73,15 @@ jobs:
6873
run: dotnet build --no-restore --configuration Release
6974

7075
- name: Test
71-
run: dotnet test --no-build --verbosity normal --configuration Release
76+
run: dotnet test --no-build --verbosity normal --configuration Release --logger trx
77+
78+
- name: Publish Test Results
79+
uses: EnricoMi/publish-unit-test-result-action@v2
80+
if: always()
81+
with:
82+
files: '**/TestResults/*.trx'
83+
check_name: 'Test Results'
84+
large_files: true
7285

7386
publish-release:
7487
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)