Skip to content

Commit ea576af

Browse files
committed
Maui Windows on CI
1 parent 8eafee9 commit ea576af

File tree

14 files changed

+224
-134
lines changed

14 files changed

+224
-134
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
build-docs: ${{ contains(github.head_ref, 'release') }}
3636
_: #@ template.replace(buildUnity())
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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+

.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:
@@ -268,7 +268,7 @@ jobs:
268268
path: ~/.nuget/packages
269269
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Benchmarks/PerformanceTests/*.csproj') }}
270270
- name: Publish Tests/Benchmarks/PerformanceTests
271-
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
271+
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
272272
- name: Output executable path
273273
id: dotnet-publish
274274
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
@@ -56,18 +56,16 @@ jobs:
5656
version: ${{ needs.build-packages.outputs.package_version }}
5757
clusterName: ${{ needs.deploy-cluster.outputs.clusterName }}
5858
secrets: {}
59-
test-uwp-managed:
60-
uses: ./.github/workflows/test-uwp-managed.yml
59+
test-windows:
60+
uses: ./.github/workflows/test-windows.yml
6161
name: Test
6262
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
6363
needs:
6464
- build-packages
6565
with:
6666
version: ${{ needs.build-packages.outputs.package_version }}
6767
clusterName: ${{ needs.deploy-cluster.outputs.clusterName }}
68-
secrets:
69-
Pfx_Password: ${{ secrets.Pfx_Password }}
70-
Base64_Encoded_Pfx: ${{ secrets.Base64_Encoded_Pfx }}
68+
secrets: {}
7169
test-net-core:
7270
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
7371
name: Test

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
path: ~/.nuget/packages
7979
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Realm.Tests/*.csproj') }}
8080
- name: Publish Tests/Realm.Tests
81-
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
81+
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
8282
- name: Output executable path
8383
id: dotnet-publish
8484
run: echo '::set-output name=executable-path::./Tests/Realm.Tests/bin/Release/${{ matrix.framework }}/${{ matrix.os.runtime }}'

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

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

0 commit comments

Comments
 (0)