diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0833267a..03b0deb9 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -261,16 +261,17 @@ jobs: 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 (without NativeAOT, see https://github.com/dotnet/runtime/issues/84908) + # Also publish the Win2D sample (with R2R) - if: matrix.platform == 'x64' name: Publish ComputeSharp.SwapChain.D2D1.Cli 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:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - # Just like for the DX12 sample, run it on x64 to validate it works correctly. + # Just like for the DX12 sample, run it on x64 to validate it works correctly - name: Run ComputeSharp.SwapChain.D2D1.Cli 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); @@ -280,7 +281,7 @@ jobs: if ($process.ExitCode -lt 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } return $process.ExitCode; - # Publish the Win2D sample with NativeAOT (just verifying the build, can't run this yet, see above) + # Publish the Win2D sample again (with NativeAOT) - if: matrix.platform == 'x64' name: Publish ComputeSharp.SwapChain.D2D1.Cli with NativeAOT run: > @@ -289,6 +290,16 @@ jobs: git clean -fdx; msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + + # Verify that the Win2D NativeAOT sample also runs correctly + - name: Run ComputeSharp.SwapChain.D2D1.Cli + 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; + $process.CloseMainWindow() | Out-Null; + $process.WaitForExit(); + if ($process.ExitCode -lt 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } + return $process.ExitCode; # Publish the native library as a NativeAOT shared library - name: Publish ComputeSharp.NativeLibrary