-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.56 KB
/
dotnet-test.yml
File metadata and controls
57 lines (48 loc) · 1.56 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
57
name: Dotnet Test and Publish Results
on:
workflow_call:
inputs:
project_path:
description: 'The project path is where the solution file is located'
required: true
type: string
dotnet-version:
description: "The Dotnet version to use"
required: true
type: string
secrets:
nuget_username:
description: Nuget username
required: true
nuget_pat:
description: Nuget PAT token
required: true
permissions:
contents: read
issues: read
checks: write
pull-requests: write
jobs:
test-and-publish-results:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ inputs.dotnet-version }}
- name: Configure NuGet Package Source
run: dotnet nuget add source https://nuget.pkg.github.com/cloudfactorydk/index.json -n cf-github -u ${{ secrets.nuget_username }} -p ${{ secrets.nuget_pat }} --store-password-in-clear-text
- name: Restore dependencies
run: dotnet restore ${{ inputs.project_path }}
- name: Build Solution
run: dotnet build ${{ inputs.project_path }} -c Release
- name: Test
run: dotnet test ${{ inputs.project_path }} -c Release --verbosity normal --logger "trx;logfilename=testResults.trx"
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
**/TestResults/*.trx