-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (62 loc) · 2.03 KB
/
Copy pathtest.yml
File metadata and controls
76 lines (62 loc) · 2.03 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test on ${{ matrix.os }} - .NET ${{ matrix.dotnet-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
dotnet-version: ['10.0.x']
fail-fast: false # Continue running other jobs if one fails
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Write Secret into file
uses: "DamianReeves/write-file-action@master"
with:
path: HyPlayer.NeteaseProvider.Tests/Secrets.cs
write-mode: overwrite
contents: |
${{ secrets.NETEASE_LOGIN_SECRET }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Run tests with coverage
run: dotnet test --configuration Release --no-build -- --coverage --report-trx --results-directory ./TestResults
- name: Upload test results
if: always() # Run even if tests fail
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-${{ matrix.dotnet-version }}
path: ./TestResults/*.trx
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.dotnet-version }}
path: ./TestResults/*.coverage
publish-results:
name: Publish Test Results
needs: test
runs-on: ubuntu-latest
if: always()
steps:
- name: Download all test results
uses: actions/download-artifact@v4
with:
pattern: test-results-*
path: ./TestResults
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: ./TestResults/**/*.trx