Skip to content

Commit

Permalink
Add Win2D WASDK sample to CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Apr 21, 2023
1 parent bdc3679 commit 6820ec1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ jobs:
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Build and run ComputeSharp.Sample
run: >
dotnet build samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj -c Release -f ${{matrix.framework}} -r win-x64 --no-self-contained -p:Platform=x64 -v n;
Expand All @@ -147,7 +149,7 @@ jobs:
dotnet build samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj -c Release -f ${{matrix.framework}} -r win-x64 --no-self-contained -p:Platform=x64 -v n;
samples\ComputeSharp.ImageProcessing\bin\x64\Release\${{matrix.framework}}\win-x64\ComputeSharp.ImageProcessing.exe
# Also publish the NativeAOT test when .NET 7 is used
# Publish the NativeAOT test when .NET 7 is used
- if: matrix.framework == 'net7.0'
name: Publish ComputeSharp.SwapChain.Cli with NativeAOT
run: >
Expand All @@ -169,6 +171,21 @@ jobs:
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net7.0\win-x64\publish\computesharp.cli.exe
if-no-files-found: error

# Also publish the Win2D sample on .NET 7 (without NativeAOT, see https://github.com/dotnet/runtime/issues/84908)
- if: matrix.framework == 'net7.0'
name: Publish ComputeSharp.SwapChain.D2D1.Cli
run: >
msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj -t:restore,publish /p:Configuration=Release
/p:Platform=x64 /p:RuntimeIdentifier=win10-x64 /p:PublishSingleFile=True /p:SelfContained=True /p:PublishTrimmed=True
- if: matrix.framework == 'net7.0'
name: Run ComputeSharp.SwapChain.D2D1.Cli
run: >
$process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net7.0-windows10.0.22621\win10-x64\publish\computesharp.d2d1.cli.exe -PassThru);
sleep -Seconds 2;
$process.CloseMainWindow() | Out-Null;
$process.WaitForExit();
$process.ExitCode
# 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x64;ARM64</Platforms>
<NoWarn>$(NoWarn);IDE0065</NoWarn>
<AssemblyName>computesharp.d2d1.cli</AssemblyName>
<ApplicationIcon>..\ComputeSharp.SwapChain.Cli\icon.ico</ApplicationIcon>
</PropertyGroup>

<PropertyGroup>

<!-- Workaround for WinRT.TypeExtensions.GetAuthoringMetadataType(Type) trim warning (see https://github.com/microsoft/CsWinRT/issues/1319) -->
<NoWarn>$(NoWarn);IL2104;IL2026</NoWarn>
</PropertyGroup>

<!-- Same optional NativeAOT property group as in ComputeSharp.SwapChain.Cli -->
Expand Down

0 comments on commit 6820ec1

Please sign in to comment.