Skip to content

Commit fd30430

Browse files
committed
Maui Windows on CI
1 parent 4a8888a commit fd30430

File tree

16 files changed

+273
-152
lines changed

16 files changed

+273
-152
lines changed

.github/templates/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- #@ template.replace(uploadPackagesToSleet("needs.build-packages.outputs.package_version", True))
5454
_: #@ template.replace(buildUnity())
5555
_: #@ template.replace(runTests(".NET Framework"))
56-
_: #@ template.replace(runTests("UWP Managed", additionalSecrets = ["Pfx_Password", "Base64_Encoded_Pfx"]))
56+
_: #@ template.replace(runTests("Windows", additionalSecrets = ["Pfx_Password", "Base64_Encoded_Pfx"]))
5757
_: #@ template.replace(runNetCoreTests("[\"netcoreapp3.1\", \"net6.0\"]"))
5858
_: #@ template.replace(runTests("macOS"))
5959
_: #@ template.replace(runTests("iOS"))
@@ -87,7 +87,7 @@ jobs:
8787
- #@ template.replace(checkoutCode())
8888
- #@ template.replace(fetchPackageArtifacts())
8989
- #@ setupDotnet()
90-
- #@ template.replace(dotnetBuildTests("Tests/Benchmarks/PerformanceTests", "net6.0", "linux-x64", "needs.build-packages.outputs.package_version"))
90+
- #@ template.replace(dotnetBuildTests("Tests/Benchmarks/PerformanceTests", "net6.0", "linux-x64", "needs.build-packages.outputs.package_version", RealmTestsStandaloneExe="true"))
9191
- name: Run the tests
9292
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/PerformanceTests -f \"*\" --join"
9393
- name: Find Results file

.github/templates/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
_: #@ template.replace(buildUnity())
3636
_: #@ template.replace(testUnity('["Mono-Net4"]', '[{ "os": "windows", "testPlatform": "Windows64" }, { "os": "linux", "testPlatform": "Linux64" }]'))
3737
_: #@ template.replace(runTests(".NET Framework", runSyncTests = False))
38-
_: #@ template.replace(runTests("UWP Managed", runSyncTests = False, additionalSecrets = ["Pfx_Password", "Base64_Encoded_Pfx"]))
38+
_: #@ template.replace(runTests("Windows", runSyncTests = False))
3939
_: #@ template.replace(runNetCoreTests('["net6.0"]'))
4040
_: #@ template.replace(runTests("macOS", runSyncTests = False))
4141
_: #@ template.replace(runTests("iOS", runSyncTests = False))

.github/templates/test-net-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: git clean -fdx
3535
- #@ setupDotnet(ifCondition = "matrix.framework == 'net6.0' && matrix.os.runner != 'macos-arm'")
3636
- #@ template.replace(fetchPackageArtifacts())
37-
- #@ template.replace(dotnetBuildTests("Tests/Realm.Tests", "${{ matrix.framework }}", "${{ matrix.os.runtime }}"))
37+
- #@ template.replace(dotnetBuildTests("Tests/Realm.Tests", "${{ matrix.framework }}", "${{ matrix.os.runtime }}", RealmTestsStandaloneExe="true"))
3838
- name: Run the tests
3939
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests --result=TestResults.xml --labels=After" + baasTestArgs("net-core-${{ matrix.runner }}-${{ matrix.runtime }}")
4040
- #@ publishTestsResults("TestResults.xml", ".NET (${{ matrix.os.runner }}, ${{ matrix.framework }})")

.github/templates/test-uwp-managed.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/templates/test-windows.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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: Run the tests
44+
#@yaml/text-templated-strings
45+
run: |
46+
.\Tests\Tests.Maui\Output\Install.ps1 -Force
47+
# Tests.Maui --headless --labels=After --result=TestResults.Windows.xml (@= baasTestArgs('Maui.Windows') @)
48+
49+
$package = Get-AppxPackage -Name realm.maui.tests
50+
Start-Process "shell:AppsFolder\$($package.PackageFamilyName)!App" -ArgumentList "--headless --labels=After --result=$(pwd)\TestResults.Windows.xml --output=$(pwd)\test.log (@= baasTestArgs('Maui.Windows') @)"
51+
Start-Sleep 5
52+
echo "Waiting for tests to finish"
53+
$(Get-Process Tests.Maui).WaitForExit(90000)
54+
Get-Content args.txt
55+
Get-Content test.log
56+
shell: powershell
57+
- #@ publishTestsResults("TestResults.Windows.xml", "Maui.Windows")
58+

.github/templates/test.lib.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@ env:
6767
#@ return msbuild(projectPath, RestoreConfigFile="Tests/Test.NuGet.Config", UseRealmNupkgsWithVersion="${{ inputs.version }}", **properties)
6868
#@ end
6969

70-
#@ def dotnetBuildTests(projectPath, framework, runtime, version = "inputs.version"):
71-
#@ properties = {
70+
#@ def dotnetBuildTests(projectPath, framework, runtime, version = "inputs.version", **properties):
71+
#@ properties.update({
7272
#@ "RestoreConfigFile": "Tests/Test.NuGet.Config",
73-
#@ "UseRealmNupkgsWithVersion": "${{ " + version + " }}",
74-
#@ "RealmTestsStandaloneExe": "true"
75-
#@ }
73+
#@ "UseRealmNupkgsWithVersion": "${{ " + version + " }}"
74+
#@ })
7675
#@ return dotnetPublish(projectPath, framework, runtime, properties)
7776
#@ end

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ jobs:
9696
BaseUrl: ${{ secrets.REALM_QA_BASE_URL }}
9797
AtlasPublicKey: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }}
9898
AtlasPrivateKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }}
99-
test-uwp-managed:
100-
uses: ./.github/workflows/test-uwp-managed.yml
99+
test-windows:
100+
uses: ./.github/workflows/test-windows.yml
101101
name: Test
102102
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
103103
needs:
@@ -260,7 +260,7 @@ jobs:
260260
with:
261261
dotnet-version: 6.0.x
262262
- name: Publish Tests/Benchmarks/PerformanceTests
263-
run: dotnet publish Tests/Benchmarks/PerformanceTests -c Release -f net6.0 -r linux-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true --no-self-contained
263+
run: dotnet publish Tests/Benchmarks/PerformanceTests -c Release -f net6.0 -r linux-x64 -p:RealmTestsStandaloneExe=true -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} --no-self-contained
264264
- name: Output executable path
265265
id: dotnet-publish
266266
run: echo '::set-output name=executable-path::./Tests/Benchmarks/PerformanceTests/bin/Release/net6.0/linux-x64'

.github/workflows/pr.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,16 @@ jobs:
6767
version: ${{ needs.build-packages.outputs.package_version }}
6868
clusterName: ${{ needs.deploy-cluster.outputs.clusterName }}
6969
secrets: {}
70-
test-uwp-managed:
71-
uses: ./.github/workflows/test-uwp-managed.yml
70+
test-windows:
71+
uses: ./.github/workflows/test-windows.yml
7272
name: Test
7373
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
7474
needs:
7575
- build-packages
7676
with:
7777
version: ${{ needs.build-packages.outputs.package_version }}
7878
clusterName: ${{ needs.deploy-cluster.outputs.clusterName }}
79-
secrets:
80-
Pfx_Password: ${{ secrets.Pfx_Password }}
81-
Base64_Encoded_Pfx: ${{ secrets.Base64_Encoded_Pfx }}
79+
secrets: {}
8280
test-net-core:
8381
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
8482
name: Test

.github/workflows/test-net-core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
name: Realm.Fody.${{ inputs.version }}
7575
path: ${{ github.workspace }}/Realm/packages/
7676
- name: Publish Tests/Realm.Tests
77-
run: dotnet publish Tests/Realm.Tests -c Release -f ${{ matrix.framework }} -r ${{ matrix.os.runtime }} -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:RealmTestsStandaloneExe=true --no-self-contained
77+
run: dotnet publish Tests/Realm.Tests -c Release -f ${{ matrix.framework }} -r ${{ matrix.os.runtime }} -p:RealmTestsStandaloneExe=true -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} --no-self-contained
7878
- name: Output executable path
7979
id: dotnet-publish
8080
run: echo '::set-output name=executable-path::./Tests/Realm.Tests/bin/Release/${{ matrix.framework }}/${{ matrix.os.runtime }}'

.github/workflows/test-unity.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
name: UnityTestsRunner.${{ matrix.platform.os }}
5858
path: ${{ github.workspace }}/Tests/Tests.Unity/Player_Standalone${{ matrix.platform.testPlatform }}_${{ matrix.settings }}/
5959
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
60+
if-no-files-found: error
6061
run-tests-linux:
6162
runs-on: ubuntu-latest
6263
name: Unity Linux

0 commit comments

Comments
 (0)