57 lines (45 loc) · 1.24 KB
/
test-runner.yml
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
57
name: CI - Test runner
on:
push:
branches:
- maindolino
pull_request:
branches:
- maindolino
workflow_dispatch:
permissions:
checks: write
jobs:
build_and_test:
env:
BUILD_CONFIG: 'Release'
SOLUTION: 'src/ItalianToolkit.sln'
PROJECT_NAME: src/ItalianToolkit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
- name: Nerdbank.GitVersioning
uses: dotnet/nbgv@v0.4
id: nbgv
with:
path: ${{ env.PROJECT_NAME }}
- name: Restore dependencies
run: dotnet restore $SOLUTION
- name: Build
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG
- name: Test
run: dotnet test $SOLUTION --configuration $BUILD_CONFIG --logger "trx;LogFileName=test-runner-results.trx" || true
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: DotNET Tests
path: "**/test-runner-results.trx"
reporter: dotnet-trx
fail-on-error: true