-
-
Notifications
You must be signed in to change notification settings - Fork 124
439 lines (397 loc) · 22.7 KB
/
dotnet.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
name: .NET
# This workflow should trigger in the following cases:
# - The commit is any push in any branch in the repo
# - The commit is a published PR from anyone else
#
# This setup is done to avoid duplicate runs for the same exact commits, for cases when
# the PR is done from a branch in this repo, which would already trigger the "push"
# condition. This way, only PRs from forks will actually trigger the workflow.
#
# Because we can't really check these conditions from the global triggers here, they are
# added to the two root jobs below instead. If canceled, the whole workflow will stop.
on: [push, pull_request]
env:
EXCLUDE_RUN_ID_FROM_PACKAGE: false
EXCLUDE_SUFFIX_FROM_VERSION: false
jobs:
# Build the whole ComputeSharp solution
build-solution:
if: >-
github.event_name == 'push' ||
github.event.pull_request.user.login != github.repository_owner
strategy:
matrix:
configuration: [Debug, Release]
platform: [x64, arm64]
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build
run: msbuild /restore -t:build /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} /bl
- name: Upload MSBuild binary log
uses: actions/upload-artifact@v4
with:
name: msbuild_log_${{matrix.configuration}}_${{matrix.platform}}
path: msbuild.binlog
if-no-files-found: error
# Pack all projects with dotnet/MSBuild to generate NuGet packages.
# This workflow also uploads the resulting packages as artifacts.
build-packages:
if: >-
github.event_name == 'push' ||
github.event.pull_request.user.login != github.repository_owner
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build ComputeSharp.Core package
run: dotnet pack src\ComputeSharp.Core\ComputeSharp.Core.csproj -c Release
- name: Build ComputeSharp package
run: dotnet pack src\ComputeSharp\ComputeSharp.csproj -c Release
- name: Build ComputeSharp.Dxc package
run: dotnet pack src\ComputeSharp.Dxc\ComputeSharp.Dxc.csproj -c Release
- name: Build ComputeSharp.D3D12MemoryAllocator package
run: dotnet pack src\ComputeSharp.D3D12MemoryAllocator\ComputeSharp.D3D12MemoryAllocator.csproj -c Release
- name: Build ComputeSharp.D2D1 package
run: dotnet pack src\ComputeSharp.D2D1\ComputeSharp.D2D1.csproj -c Release
- name: Build ComputeSharp.Pix package
run: dotnet pack src\ComputeSharp.Pix\ComputeSharp.Pix.csproj -c Release
- name: Build ComputeSharp.Uwp package
run: msbuild src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj /restore -t:pack /p:Configuration=Release
- name: Build ComputeSharp.WinUI package
run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj /restore -t:pack /p:Configuration=Release
- name: Build ComputeSharp.D2D1.Uwp package
run: msbuild src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj /restore -t:pack /p:Configuration=Release
- name: Build ComputeSharp.D2D1.WinUI package
run: msbuild src\ComputeSharp.D2D1.WinUI\ComputeSharp.D2D1.WinUI.csproj /restore -t:pack /p:Configuration=Release
# Upload the packages to the pipeline artifacts
- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: nuget_packages
path: artifacts\*.nupkg
if-no-files-found: error
# Run all unit tests referencing the ComputeSharp projects directly
run-tests:
needs: [build-solution]
runs-on: windows-2022
# Set the environment variable which is then looked up in ComputeSharp.Dxc.
# This is a workaround for https://github.com/actions/runner-images/issues/6531.
env:
CI_RUNNER_DOTNET_TEST_PLATFORM: x64
steps:
- name: Git checkout
uses: actions/checkout@v4
# DirectX 12 unit tests
- name: Run ComputeSharp.Tests
run: dotnet test tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.DisableDynamicCompilation
run: dotnet test tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.GlobalStatements
run: dotnet run --project tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.Internals
run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
# Run the source generator tests as well (even though they're not really runtime specific)
- name: Run ComputeSharp.Tests.SourceGenerators
run: dotnet test tests\ComputeSharp.Tests.SourceGenerators\ComputeSharp.Tests.SourceGenerators.csproj -v n -l "console;verbosity=detailed"
# DirectX 12 device lost unit tests.
# These tests are run one class at a time to ensure there's no accidental conflicts between any of them. This is because
# the code paths being tested in this project are heavily dependent on process-wide mutable state (ie. DirectX 12 devices).
- name: Run ComputeSharp.Tests.DeviceLost "DeviceDisposal"
run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceDisposal" -c Release -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.DeviceLost "DeviceLost"
run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceLost" -c Release -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.DeviceLost "GetDefaultDevice"
run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=GetDefaultDevice" -c Release -v n -l "console;verbosity=detailed"
# D2D1 unit tests
- name: Run ComputeSharp.D2D1.Tests
run: dotnet test tests\ComputeSharp.D2D1.Tests\ComputeSharp.D2D1.Tests.csproj -c Release -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.D2D1.Tests.AssemblyLevelAttributes
run: dotnet test tests\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj -c Release -v n -l "console;verbosity=detailed"
# Run the D2D1 source generators tests as well
- name: Run ComputeSharp.D2D1.Tests.SourceGenerators
run: dotnet test tests\ComputeSharp.D2D1.Tests.SourceGenerators\ComputeSharp.D2D1.Tests.SourceGenerators.csproj -v n -l "console;verbosity=detailed"
# Run all unit tests using D3D12MA
run-tests-d3d12ma:
needs: [build-solution]
runs-on: windows-2022
env:
CI_RUNNER_DOTNET_TEST_PLATFORM: x64
steps:
- name: Git checkout
uses: actions/checkout@v4
# D3D12MA tests (main ComputeSharp tests, as well as the device lost ones)
- name: Run ComputeSharp.Tests
run: dotnet test tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj -c Release /p:Platform=x64 /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.DeviceLost "DeviceDisposal"
run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceDisposal" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.DeviceLost "DeviceLost"
run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceLost" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.DeviceLost "GetDefaultDevice"
run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=GetDefaultDevice" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
# Run all Win2D tests (separately, as they need VS Test)
run-tests-win2d:
needs: [build-solution]
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# Build the D2D1 WinAppSDK unit tests
- name: Build ComputeSharp.D2D1.WinUI.Tests
run: msbuild tests\ComputeSharp.D2D1.WinUI.Tests\ComputeSharp.D2D1.WinUI.Tests.csproj /restore -t:build /p:Configuration=Release /p:Platform=x64
# Run the D2D1 WinAppSDK unit tests with VS Test
- name: Run ComputeSharp.D2D1.WinUI.Tests
run: >
$vs_path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop -requiresAny -property installationPath;
$vstest_path = join-path $vs_path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe';
& $vstest_path /Platform:x64 tests\ComputeSharp.D2D1.WinUI.Tests\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64\ComputeSharp.D2D1.WinUI.Tests.build.appxrecipe
# Build the D2D1 WinAppSDK source generators tests
- name: Build ComputeSharp.D2D1.WinUI.Tests.SourceGenerators
run: msbuild tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj /restore -t:build /p:Configuration=Release /p:Platform=x64
# Run the D2D1 WinAppSDK source generators tests (same as above)
- name: Run ComputeSharp.D2D1.WinUI.Tests.SourceGenerators
run: >
$vs_path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop -requiresAny -property installationPath;
$vstest_path = join-path $vs_path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe';
& $vstest_path /Platform:x64 tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\bin\x64\Release\net8.0-windows10.0.22621.0\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.dll
# Run all the local samples to ensure they build and run with no errors
run-samples:
needs: [build-solution]
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Build and run ComputeSharp.Sample
run: >
dotnet build samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.Sample\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.exe
- name: Build and run ComputeSharp.Sample.FSharp
run: >
dotnet build samples\ComputeSharp.Sample.FSharp\ComputeSharp.Sample.FSharp.fsproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.Sample.FSharp\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.FSharp.exe
- name: Build and run ComputeSharp.ImageProcessing.csproj
run: >
dotnet build samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.ImageProcessing\bin\x64\Release\net8.0\win-x64\ComputeSharp.ImageProcessing.exe
# Run the NativeAOT samples as well
run-samples-aot:
needs: [build-solution]
strategy:
matrix:
platform: [x64, arm64]
runs-on: windows-2022
env:
CI_RUNNER_SAMPLES_INTEGRATION_TESTS: true
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# Publish the NativeAOT CLI sample (optimized for speed)
- name: Publish ComputeSharp.SwapChain.Cli with NativeAOT (speed)
run: >
$env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true';
dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-${{matrix.platform}} -v n
# If on x64, also run it (this script will launch it and let it run for 2 seconds, before closing it).
# Note: for this and all other equivalent tests below, we're only throwing on failures that are not
# -1073741510 (STATUS_CONTROL_C_EXIT). That error is sometimes thrown when running the test in the CI.
# We don't want to fail in that case, as it still means the sample has in fact ran with no problems.
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.Cli (speed)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru);
sleep -Seconds 2;
try
{
$process.CloseMainWindow() | Out-Null;
$process.WaitForExit();
}
catch { }
if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
# Upload the binary (to track binary size trends)
- if: matrix.platform == 'x64'
name: Upload NativeAOT CLI sample (speed)
uses: actions/upload-artifact@v4
with:
name: computesharp.cli.opt-speed.exe
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe
if-no-files-found: error
# Publish the NativeAOT CLI sample (optimized for size, and reflection-free)
- name: Publish ComputeSharp.SwapChain.Cli with NativeAOT (size)
run: >
$env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true';
$env:COMPUTESHARP_SWAPCHAIN_CLI_SIZE_OPTIMIZED='true';
$env:COMPUTESHARP_SWAPCHAIN_CLI_DISABLE_REFLECTION='true';
git clean -fdx;
dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-${{matrix.platform}} -v n
# Again only on x64, also run the sample and validate it works correctly
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.Cli (size)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru);
sleep -Seconds 2;
try
{
$process.CloseMainWindow() | Out-Null;
$process.WaitForExit();
}
catch { }
if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
# Upload the binary again (with a different name)
- if: matrix.platform == 'x64'
name: Upload NativeAOT CLI sample (size)
uses: actions/upload-artifact@v4
with:
name: computesharp.cli.opt-size.exe
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe
if-no-files-found: error
# Also publish the Win2D sample (with R2R)
- name: Publish ComputeSharp.SwapChain.D2D1.Cli (R2R)
run: >
$env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='true';
$env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='false';
git clean -fdx;
msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish
/p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
# Just like for the DX12 sample, run it on x64 to validate it works correctly
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.D2D1.Cli (R2R)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru);
sleep -Seconds 2;
try
{
$process.CloseMainWindow() | Out-Null;
$process.WaitForExit();
}
catch { }
if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
# Publish the Win2D sample again (with NativeAOT)
- name: Publish ComputeSharp.SwapChain.D2D1.Cli (NativeAOT)
run: >
$env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='false';
$env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='true';
git clean -fdx;
msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish
/p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
# Verify that the Win2D NativeAOT sample also runs correctly
- if: matrix.platform == 'x64'
name: Run ComputeSharp.SwapChain.D2D1.Cli (NativeAOT)
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru);
sleep -Seconds 2;
try
{
$process.CloseMainWindow() | Out-Null;
$process.WaitForExit();
}
catch { }
if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
# Publish the native library as a NativeAOT shared library
- name: Publish ComputeSharp.NativeLibrary
run: dotnet publish samples\ComputeSharp.NativeLibrary\ComputeSharp.NativeLibrary.csproj -r win-${{matrix.platform}} -v n
# Publish the WinRT component with NativeAOT as well
- if: matrix.platform == 'x64'
name: Publish ComputeSharp.NativeLibrary.WinRT
run: >
msbuild samples\ComputeSharp.NativeLibrary.WinRT\ComputeSharp.NativeLibrary.WinRT.csproj /restore -t:publish
/p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
# Publish the WinUI 3 sample app with NativeAOT
- if: matrix.platform == 'x64'
name: Publish ComputeSharp.SwapChain.WinUI
run: >
msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj /restore -t:publish
/p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
# Publish the D2D1 UWP (CoreApplication) sample app with NativeAOT
- if: matrix.platform == 'x64'
name: Publish ComputeSharp.SwapChain.D2D1.Uwp
run: >
msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish
/p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
# Publish the D2D1 UWP sample app again with NativeAOT, with Xbox support
- if: matrix.platform == 'x64'
name: Publish ComputeSharp.SwapChain.D2D1.Uwp (Xbox)
run: >
$env:EXPERIMENTAL_XBOX_SUPPORT='true';
msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish
/p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
# Download the NuGet packages generated in the previous job and use them
# to build and run the sample project referencing them. This is used as
# a test to ensure the NuGet packages work in a consuming project.
verify-packages:
needs: [build-packages]
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Create local NuGet feed
run: mkdir artifacts
- name: Download package artifacts
uses: actions/download-artifact@v4
with:
name: nuget_packages
path: artifacts
- name: Build and run ComputeSharp.NuGet
run: dotnet run --project tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n
- name: Build and run ComputeSharp.Dxc.NuGet
run: dotnet run --project tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n
- name: Build and run ComputeSharp.Pix.NuGet
run: dotnet run --project tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n
# Run the extra tests to validate a number of build and publishing configurations.
# This is used to ensure the native dependencies can always be loaded correctly
# regardless of whether the app is shipping with R2R, self-contained, etc.
- name: Run ComputeSharp.Tests.NativeLibrariesResolver
run: dotnet test tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj -v n -l "console;verbosity=detailed"
# Also run the NativeAOT publishing tests
- name: Publish and run ComputeSharp.NuGet with NativeAOT
run: >
$env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true';
dotnet publish tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj -r win-x64 -v n;
tests\ComputeSharp.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.NuGet.exe
- name: Publish and run ComputeSharp.Dxc.NuGet with NativeAOT
run: >
$env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true';
dotnet publish tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj -r win-x64 -v n;
tests\ComputeSharp.Dxc.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.Dxc.NuGet.exe
- name: Publish and run ComputeSharp.Pix.NuGet with NativeAOT
run: >
$env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true';
dotnet publish tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj -r win-x64 -v n;
tests\ComputeSharp.Pix.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.Pix.NuGet.exe
# Publish the packages to GitHub packages
publish-nightlies-github:
needs: [run-tests, run-tests-d3d12ma, run-tests-win2d, run-samples, run-samples-aot, verify-packages]
runs-on: windows-2022
if: ${{github.event_name == 'push'}}
steps:
- uses: actions/download-artifact@v4
with:
name: nuget_packages
path: artifacts
- run: dotnet nuget push "artifacts\*.nupkg" --source "https://nuget.pkg.github.com/${{github.repository_owner}}/index.json" --api-key ${{secrets.GITHUB_TOKEN}} --skip-duplicate
# Publish the packages to Azure DevOps. This step has will not fail the CI even if it is not
# successful, so as to not block PRs and hinder development just because eg. the Azure storage
# has exceeded the limit. These packages are rarely needed anyway, so that's fine.
publish-nightlies-azure-devops:
needs: [run-tests, run-tests-d3d12ma, run-tests-win2d, run-samples, run-samples-aot, verify-packages]
runs-on: windows-2022
if: ${{github.event_name == 'push'}}
steps:
- uses: actions/download-artifact@v4
with:
name: nuget_packages
path: artifacts
- uses: actions/setup-dotnet@v4
with:
source-url: "https://sergio0694.pkgs.visualstudio.com/ComputeSharp/_packaging/ComputeSharp/nuget/v3/index.json"
env:
NUGET_AUTH_TOKEN: ${{ secrets.ADO_FEED_PERSONAL_ACCESS_TOKEN }}
- run: dotnet nuget push "artifacts\*.nupkg" --api-key AzureDevOps --skip-duplicate
continue-on-error: true