-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (71 loc) · 2.7 KB
/
Copy pathpr-test.yml
File metadata and controls
83 lines (71 loc) · 2.7 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
77
78
79
80
81
82
83
# PR 验证工作流:构建 + 单元测试 + 冒烟测试编译
# 每次 PR 到 master 时自动触发,确保代码能编译、测试通过、冒烟测试可构建。
# 与 build-tlx.yml( nightly 打包 .tlx)互补:pr-test 轻量快速、tlx 构建重但产 artifact。
name: PR Test
on:
pull_request:
branches: [ "master" ]
push:
branches: [ "master" ]
jobs:
build-and-test:
runs-on: windows-latest
permissions:
contents: read
steps:
- name: Checkout DiffSingerForTuneLab
uses: actions/checkout@v4
with:
fetch-depth: 0
path: DiffSingerForTuneLab
- name: Checkout TuneLab SDK (release/2.0.0)
uses: actions/checkout@v4
with:
repository: LiuYunPlayer/TuneLab
ref: release/2.0.0
path: TuneLab
sparse-checkout: |
TuneLab.SDK
TuneLab.Foundation
sparse-checkout-cone-mode: false
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore NuGet packages
shell: pwsh
run: |
Set-Location DiffSingerForTuneLab
# 主插件、测试项目、冒烟工具是三个独立项目(测试/工具不被主 csproj 引用,
# 裸 dotnet restore 只覆盖主插件),后续 build 步骤用 --no-restore,故此处逐个 restore。
dotnet restore
dotnet restore tests/DiffSinger.Tests/DiffSinger.Tests.csproj
dotnet restore tools/DiffSingerSmokeTest/DiffSingerSmokeTest.csproj
- name: Build plugin (Release)
shell: pwsh
run: |
Set-Location DiffSingerForTuneLab
dotnet build --configuration Release --no-restore -v minimal
- name: Build unit tests
shell: pwsh
run: |
Set-Location DiffSingerForTuneLab
dotnet build tests/DiffSinger.Tests/DiffSinger.Tests.csproj --configuration Release --no-restore -v minimal
- name: Run unit tests
shell: pwsh
run: |
Set-Location DiffSingerForTuneLab
dotnet test tests/DiffSinger.Tests/DiffSinger.Tests.csproj --configuration Release --no-build --logger:"console;verbosity=normal"
- name: Build smoke test tool
shell: pwsh
run: |
Set-Location DiffSingerForTuneLab
dotnet build tools/DiffSingerSmokeTest/DiffSingerSmokeTest.csproj --configuration Release --no-restore -v minimal
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ github.sha }}
path: |
DiffSingerForTuneLab/tests/**/TestResult*.xml
retention-days: 7