-
-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (45 loc) · 1.59 KB
/
dotnetpackage.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
58
name: .NET
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
env:
ProjectName: ThrottleDebounce
runs-on: windows-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Initialize test reporting
uses: testspace-com/setup-testspace@v1
with:
domain: ${{github.repository_owner}}
- name: Restore
run: dotnet restore --verbosity normal
- name: Build
run: dotnet build ${{ env.ProjectName }} --no-restore --configuration Release
- name: Pack
run: dotnet pack ${{ env.ProjectName }} --no-build --configuration Release
- name: Test
run: |
dotnet test Tests --configuration Release --collect:"XPlat Code Coverage" --settings Tests/coverlet.runsettings --logger "trx;LogFileName=TestResults.xml" --verbosity normal
Out-File -InputObject "TEST_EXIT_CODE=$LASTEXITCODE" -FilePath $env:GITHUB_ENV -Append -Encoding UTF8
Copy-Item Tests/TestResults/*/coverage.info Tests/TestResults -ErrorAction Continue
exit 0
- name: Upload test report
run: testspace Tests/TestResults/*.xml
- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: Tests/TestResults/coverage.info
format: lcov
- name: Stop if tests failed
run: exit $env:TEST_EXIT_CODE
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: ${{ env.ProjectName }}.nupkg
path: ${{ env.ProjectName }}/bin/Release/*.*nupkg
if-no-files-found: error