Skip to content

Commit cf83cfe

Browse files
Update dotnet.yml
1 parent 40cca4d commit cf83cfe

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

.github/workflows/dotnet.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,39 @@
1-
# This workflow will build a .NET project
1+
# This workflow will build and test a .NET project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
33

4-
name: .NET
4+
name: .NET
55

66
on:
7-
push:
7+
push:
88
branches: [ "main" ]
9-
pull_request:
9+
pull_request:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
build:
14-
13+
build-and-test:
1514
runs-on: ubuntu-latest
1615

1716
steps:
18-
- uses: actions/checkout@v4
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
1920
- name: Setup .NET
2021
uses: actions/setup-dotnet@v4
2122
with:
2223
dotnet-version: 8.0.x
24+
2325
- name: Restore dependencies
2426
run: dotnet restore
25-
- name: Build
27+
28+
- name: Build project
2629
run: dotnet build --no-restore
27-
- name: Test
28-
run: dotnet test --no-build --verbosity normal
30+
31+
- name: Run tests
32+
run: dotnet test --no-build --verbosity normal --logger:"trx;LogFileName=test_results.trx"
33+
34+
- name: Upload Test Results
35+
if: always()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: test-results
39+
path: '**/TestResults/*.trx'

0 commit comments

Comments
 (0)