diff --git a/build/ci/.azure-devops-project-template-tests.yml b/build/ci/.azure-devops-project-template-tests.yml index 351cb995a968..7b97dac66b33 100644 --- a/build/ci/.azure-devops-project-template-tests.yml +++ b/build/ci/.azure-devops-project-template-tests.yml @@ -65,7 +65,7 @@ jobs: - script: dotnet new -i $(System.ArtifactsDirectory)\NugetPackages\vslatest\Uno.ProjectTemplates.Dotnet*.nupkg displayName: Install Project Templates - - powershell: build\test-scripts\run-net6-template-tests.ps1 + - powershell: build\test-scripts\run-net6-mobile-template-tests.ps1 displayName: Run Project Templates Tests env: NUGET_CI_CONFIG: $(Build.SourcesDirectory)\src\nuget.ci.net6.config @@ -103,3 +103,33 @@ jobs: displayName: Run Project Templates Tests env: NUGET_CI_CONFIG: $(Build.SourcesDirectory)/src/nuget.ci.config + +- job: Dotnet_Template_Tests_net7_Linux + displayName: 'dotnet new Templates Tests - Linux (net7)' + + pool: + vmImage: ${{ parameters.vmImageLinux }} + + container: unoplatform/wasm-build:2.3 + + dependsOn: Generate_Packages + + steps: + - task: DownloadBuildArtifacts@0 + inputs: + artifactName: NugetPackages + + - template: templates/gitversion.yml + + - script: cp $(System.ArtifactsDirectory)/NugetPackages/vslatest/*.nupkg $(Build.SourcesDirectory)/src/PackageCache + displayName: Copy Artifacts to PackageCache + + - template: templates/dotnet-install.yml + + - script: dotnet new -i $(System.ArtifactsDirectory)/NugetPackages/vslatest/Uno.ProjectTemplates.Dotnet*.nupkg + displayName: Install Project Templates + + - pwsh: build/test-scripts/run-net7-template-linux.ps1 + displayName: Run Project Templates Tests + env: + NUGET_CI_CONFIG: $(Build.SourcesDirectory)/src/nuget.ci.config diff --git a/build/test-scripts/run-net6-template-tests.ps1 b/build/test-scripts/run-net6-mobile-template-tests.ps1 similarity index 100% rename from build/test-scripts/run-net6-template-tests.ps1 rename to build/test-scripts/run-net6-mobile-template-tests.ps1 diff --git a/build/test-scripts/run-net7-template-linux.ps1 b/build/test-scripts/run-net7-template-linux.ps1 new file mode 100644 index 000000000000..e002942f75ae --- /dev/null +++ b/build/test-scripts/run-net7-template-linux.ps1 @@ -0,0 +1,68 @@ +Set-PSDebug -Trace 1 + +$ErrorActionPreference = 'Stop' + +function Assert-ExitCodeIsZero() +{ + if ($LASTEXITCODE -ne 0) + { + throw "Exit code must be zero." + } +} + +function Get-TemplateConfiguration( + [bool]$android = $false, + [bool]$iOS = $false, + [bool]$macOS = $false, + [bool]$wasm = $false, + [bool]$skiaGtk = $false, + [bool]$skiaWpf = $false, + [bool]$skiaLinuxFB = $false, + [bool]$wasmVsCode = $false) +{ + $androidFlag = '-android' + $iOSFlag = '-ios' + $macOSFlag = '-macos' + $wasmFlag = '-wasm' + $wasmVsCodeFlag = '--vscode' + $skiaWpfFlag = '--skia-wpf' + $skiaGtkFlag = '--skia-gtk' + $skiaLinuxFBFlag = '--skia-linux-fb' + + $a = If ($android) { $androidFlag } Else { $androidFlag + '=false' } + $b = If ($iOS) { $iOSFlag } Else { $iOSFlag + '=false' } + $c = If ($macOS) { $macOSFlag } Else { $macOSFlag + '=false' } + $d = If ($wasm) { $wasmFlag } Else { $wasmFlag + '=false' } + $e = If ($wasmVsCode) { $wasmVsCodeFlag } Else { $wasmVsCodeFlag + '=false' } + $f = If ($skiaWpf) { $skiaWpfFlag } Else { $skiaWpfFlag + '=false' } + $g = If ($skiaGtk) { $skiaGtkFlag } Else { $skiaGtkFlag + '=false' } + $h = If ($skiaLinuxFB) { $skiaLinuxFB } Else { $skiaLinuxFBFlag + '=false' } + + @($a, $b, $c, $d, $e, $f, $g, $h) +} + +$default = @('-v', 'detailed', "-p:RestoreConfigFile=$env:NUGET_CI_CONFIG") + +$debug = $default + '-c' + 'Debug' +$release = $default + '-c' + 'Release' + +# WinUI +dotnet new unoapp -n UnoAppWinUI -Framework net7.0 (Get-TemplateConfiguration -wasm 1 -wasmVsCode 1 -skiaGtk 1 -skiaLinuxFB 1) + +dotnet build $debug UnoAppWinUI/UnoAppWinUI.Wasm/UnoAppWinUI.Wasm.csproj +Assert-ExitCodeIsZero + +dotnet build $release UnoAppWinUI/UnoAppWinUI.Wasm/UnoAppWinUI.Wasm.csproj +Assert-ExitCodeIsZero + +dotnet build $debug UnoAppWinUI/UnoAppWinUI.Skia.Gtk/UnoAppWinUI.Skia.Gtk.csproj +Assert-ExitCodeIsZero + +dotnet build $release UnoAppWinUI/UnoAppWinUI.Skia.Gtk/UnoAppWinUI.Skia.Gtk.csproj +Assert-ExitCodeIsZero + +dotnet build $debug UnoAppWinUI/UnoAppWinUI.Skia.Linux.FrameBuffer/UnoAppWinUI.Skia.Linux.FrameBuffer.csproj +Assert-ExitCodeIsZero + +dotnet build $release UnoAppWinUI/UnoAppWinUI.Skia.Linux.FrameBuffer/UnoAppWinUI.Skia.Linux.FrameBuffer.csproj +Assert-ExitCodeIsZero