-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (108 loc) · 3.75 KB
/
ci.yml
File metadata and controls
128 lines (108 loc) · 3.75 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: Build & Test (${{ matrix.configuration }} | ${{ matrix.platform }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
platform: [x64]
env:
Solution_Path: ShaderLab.slnx
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/packages.config', '**/*.vcxproj') }}
restore-keys: nuget-${{ runner.os }}-
- name: NuGet restore
run: nuget restore "${{ env.Solution_Path }}" -SolutionDirectory .
- name: Build solution
shell: pwsh
run: |
msbuild "${{ env.Solution_Path }}" `
/p:Configuration=${{ env.Configuration }} `
/p:Platform=${{ env.Platform }} `
/p:AppxBundle=Never `
/p:AppxPackageSigningEnabled=false `
/p:GenerateAppxPackageOnBuild=true `
/p:UapAppxPackageBuildMode=SideloadOnly `
/m /nologo /v:minimal
- name: Run unit tests
shell: pwsh
run: |
$exe = "$env:GITHUB_WORKSPACE\${{ env.Platform }}\${{ env.Configuration }}\ShaderLabTests\ShaderLabTests.exe"
if (-not (Test-Path $exe)) {
Write-Error "Test runner not found at $exe"
exit 1
}
& $exe --adapter warp
if ($LASTEXITCODE -ne 0) {
Write-Error "ShaderLabTests reported $LASTEXITCODE failure(s)"
exit $LASTEXITCODE
}
- name: Upload AppX layout artifact
if: matrix.configuration == 'Release'
uses: actions/upload-artifact@v4
with:
name: ShaderLab-${{ matrix.platform }}-${{ matrix.configuration }}
path: AppPackages/**
if-no-files-found: warn
retention-days: 14
- name: Upload build logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.configuration }}-${{ matrix.platform }}
path: |
**/*.log
${{ env.Platform }}/${{ env.Configuration }}/**/*.tlog
if-no-files-found: ignore
retention-days: 7
bootstrap-smoke:
name: Bootstrap.ps1 smoke (clean clone)
runs-on: windows-latest
# Catches onboarding-cliff regressions: a fresh clone must build via
# the documented one-command setup. Only runs Debug|x64 -- the full
# matrix is build-and-test above.
steps:
- name: Checkout (clean)
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Run Bootstrap.ps1 (cert + ExprTk + restore + smoke build)
shell: pwsh
run: .\Bootstrap.ps1 -Build -Configuration Debug -Platform x64
- name: Run unit tests
shell: pwsh
run: |
$exe = "$env:GITHUB_WORKSPACE\x64\Debug\ShaderLabTests\ShaderLabTests.exe"
& $exe --adapter warp
if ($LASTEXITCODE -ne 0) {
Write-Error "ShaderLabTests reported $LASTEXITCODE failure(s)"
exit $LASTEXITCODE
}
- name: Run headless smoke
shell: pwsh
run: .\Tests\RunHeadlessSmoke.ps1 -Configuration Debug -Platform x64