-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.37 KB
/
test.yml
File metadata and controls
56 lines (46 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Test & Report
on:
push:
paths:
- src/**
- .github/workflows/test.yml
pull_request:
paths:
- src/**
- .github/workflows/test.yml
workflow_dispatch:
env:
PROJECT: src
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: |
dotnet workload update
dotnet workload install aspire
- name: Restore dependencies
run: dotnet restore ${{ env.PROJECT }}
- name: Build
run: dotnet build ${{ env.PROJECT }} --no-restore
- name: Test
run: |
dotnet test ${{ env.PROJECT }} \
--verbosity normal \
--configuration Release \
--logger "trx;LogFileName=${{ github.workspace }}/test-results/unit-tests.trx" \
-p:CollectCoverage=true \
-p:CoverletOutputFormat="opencover" \
-p:CoverletOutput=${{ github.workspace }}/test-results/cover.xml
- name: Test Report
uses: bibipkins/dotnet-test-reporter@v1.4.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-title: 'Unit Test Results'
results-path: ${{ github.workspace }}/test-results/unit-tests.trx
coverage-path: ${{ github.workspace }}/test-results/cover.xml