|
| 1 | +#@ load("@ytt:template", "template") |
| 2 | +#@ load("common.lib.yml", "checkoutCode", "setupDotnet") |
| 3 | +#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "dotnetBuildTests") |
| 4 | + |
| 5 | +#@ def importPfx(id): |
| 6 | +name: Import test certificate |
| 7 | +id: #@ id |
| 8 | +#@yaml/text-templated-strings |
| 9 | +run: | |
| 10 | + $cert = New-SelfSignedCertificate -Type Custom -Subject "CN=RealmTests" -KeyUsage DigitalSignature -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") |
| 11 | + echo "::set-output name=thumbprint::$($cert.Thumbprint)" |
| 12 | +shell: powershell |
| 13 | +#@ end |
| 14 | + |
| 15 | +--- |
| 16 | +name: test-windows |
| 17 | +_: #@ template.replace(testDefinition()) |
| 18 | +jobs: |
| 19 | + test-uwp: |
| 20 | + runs-on: windows-2019 |
| 21 | + name: UWP |
| 22 | + timeout-minutes: 45 |
| 23 | + steps: |
| 24 | + - #@ template.replace(checkoutCode()) |
| 25 | + - #@ template.replace(fetchPackageArtifacts()) |
| 26 | + - #@ importPfx("import-pfx") |
| 27 | + - #@ template.replace(buildTests("Tests/Tests.UWP", AppxBundle="Always", PackageCertificateThumbprint="${{ steps.import-pfx.outputs.thumbprint }}", UseDotNetNativeToolchain="false", AppxBundlePlatforms="x64")) |
| 28 | + - name: Run the tests |
| 29 | + run: #@ "./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs '" + baasTestArgs("uwp-managed") + "'" |
| 30 | + shell: powershell |
| 31 | + - #@ publishTestsResults("${{ env.TEST_RESULTS }}", "UWP Managed") |
| 32 | + test-maui: |
| 33 | + runs-on: windows-2019 |
| 34 | + name: Maui.Windows |
| 35 | + timeout-minutes: 45 |
| 36 | + steps: |
| 37 | + - #@ template.replace(checkoutCode()) |
| 38 | + - #@ template.replace(fetchPackageArtifacts()) |
| 39 | + - #@ setupDotnet() |
| 40 | + - run: dotnet workload install maui |
| 41 | + - #@ importPfx("import-pfx") |
| 42 | + - #@ template.replace(dotnetBuildTests("Tests/Tests.Maui", "net6.0-windows10.0.19041", "win10-x64", GenerateAppxPackageOnBuild="true", PackageCertificateThumbprint="${{ steps.import-pfx.outputs.thumbprint }}", AppxPackageTestDir="Output/")) |
| 43 | + - name: Deploy |
| 44 | + run: .\Tests\Tests.Maui\Output\Install.ps1 -Force |
| 45 | + - name: Run |
| 46 | + #@yaml/text-templated-strings |
| 47 | + run: Tests.Maui.exe --headless --labels=After --result=TestResults.Windows.xml (@= baasTestArgs('Maui.Windows') @) |
| 48 | + - #@ publishTestsResults("TestResults.Windows.xml", "Maui.Windows") |
| 49 | + |
0 commit comments