-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8eafee9
commit ea576af
Showing
14 changed files
with
224 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#@ load("@ytt:template", "template") | ||
#@ load("common.lib.yml", "checkoutCode", "setupDotnet") | ||
#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "dotnetBuildTests") | ||
|
||
#@ def importPfx(id): | ||
name: Import test certificate | ||
id: #@ id | ||
#@yaml/text-templated-strings | ||
run: | | ||
$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}") | ||
echo "::set-output name=thumbprint::$($cert.Thumbprint)" | ||
shell: powershell | ||
#@ end | ||
|
||
--- | ||
name: test-windows | ||
_: #@ template.replace(testDefinition()) | ||
jobs: | ||
test-uwp: | ||
runs-on: windows-2019 | ||
name: UWP | ||
timeout-minutes: 45 | ||
steps: | ||
- #@ template.replace(checkoutCode()) | ||
- #@ template.replace(fetchPackageArtifacts()) | ||
- #@ importPfx("import-pfx") | ||
- #@ template.replace(buildTests("Tests/Tests.UWP", AppxBundle="Always", PackageCertificateThumbprint="${{ steps.import-pfx.outputs.thumbprint }}", UseDotNetNativeToolchain="false", AppxBundlePlatforms="x64")) | ||
- name: Run the tests | ||
run: #@ "./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs '" + baasTestArgs("uwp-managed") + "'" | ||
shell: powershell | ||
- #@ publishTestsResults("${{ env.TEST_RESULTS }}", "UWP Managed") | ||
test-maui: | ||
runs-on: windows-2019 | ||
name: Maui.Windows | ||
timeout-minutes: 45 | ||
steps: | ||
- #@ template.replace(checkoutCode()) | ||
- #@ template.replace(fetchPackageArtifacts()) | ||
- #@ setupDotnet() | ||
- run: dotnet workload install maui | ||
- #@ importPfx("import-pfx") | ||
- #@ template.replace(dotnetBuildTests("Tests/Tests.Maui", "net6.0-windows10.0.19041", "win10-x64", GenerateAppxPackageOnBuild="true", PackageCertificateThumbprint="${{ steps.import-pfx.outputs.thumbprint }}", AppxPackageTestDir="Output/")) | ||
- name: Deploy | ||
run: .\Tests\Tests.Maui\Output\Install.ps1 -Force | ||
- name: Run | ||
#@yaml/text-templated-strings | ||
run: Tests.Maui.exe --headless --labels=After --result=TestResults.Windows.xml (@= baasTestArgs('Maui.Windows') @) | ||
- #@ publishTestsResults("TestResults.Windows.xml", "Maui.Windows") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
name: test-windows | ||
"on": | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
clusterName: | ||
required: false | ||
type: string | ||
secrets: | ||
AtlasProjectId: | ||
required: false | ||
BaseUrl: | ||
required: false | ||
AtlasPublicKey: | ||
required: false | ||
AtlasPrivateKey: | ||
required: false | ||
env: | ||
REALM_DISABLE_ANALYTICS: true | ||
DOTNET_NOLOGO: true | ||
jobs: | ||
test-uwp: | ||
runs-on: windows-2019 | ||
name: UWP | ||
timeout-minutes: 45 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: false | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Register csc problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/csc.json" | ||
- name: Register msvc problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/msvc.json" | ||
- name: Fetch Realm | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: Realm.${{ inputs.version }} | ||
path: ${{ github.workspace }}/Realm/packages/ | ||
- name: Fetch Realm.Fody | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: Realm.Fody.${{ inputs.version }} | ||
path: ${{ github.workspace }}/Realm/packages/ | ||
- name: Import test certificate | ||
id: import-pfx | ||
run: | | ||
$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}") | ||
echo "::set-output name=thumbprint::$($cert.Thumbprint)" | ||
shell: powershell | ||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
if: ${{ runner.os == 'Windows' }} | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Tests.UWP/*.csproj') }} | ||
- name: Build Tests/Tests.UWP | ||
run: msbuild Tests/Tests.UWP -p:Configuration=Release -restore -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:AppxBundle=Always -p:PackageCertificateThumbprint=${{ steps.import-pfx.outputs.thumbprint }} -p:UseDotNetNativeToolchain=false -p:AppxBundlePlatforms=x64 | ||
- name: Run the tests | ||
run: ./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs ' --baasurl=${{ secrets.BaseUrl }} --baascluster=${{ inputs.clusterName }} --baasapikey=${{ secrets.AtlasPublicKey}} --baasprivateapikey=${{ secrets.AtlasPrivateKey}} --baasprojectid=${{ secrets.AtlasProjectId }} --baasdifferentiator=uwp-managed' | ||
shell: powershell | ||
- name: Publish Unit Test Results | ||
uses: LaPeste/test-reporter@b8a650f4490e7472b930f56bbb92c7b42dc5db15 | ||
if: always() | ||
with: | ||
name: Results UWP Managed | ||
path: ${{ env.TEST_RESULTS }} | ||
reporter: java-junit | ||
list-suites: failed | ||
list-tests: failed | ||
path-replace-backslashes: true | ||
fail-on-error: false | ||
test-maui: | ||
runs-on: windows-2019 | ||
name: Maui.Windows | ||
timeout-minutes: 45 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: false | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Register csc problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/csc.json" | ||
- name: Register msvc problem matcher | ||
run: echo "::add-matcher::.github/problem-matchers/msvc.json" | ||
- name: Fetch Realm | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: Realm.${{ inputs.version }} | ||
path: ${{ github.workspace }}/Realm/packages/ | ||
- name: Fetch Realm.Fody | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: Realm.Fody.${{ inputs.version }} | ||
path: ${{ github.workspace }}/Realm/packages/ | ||
- name: Configure .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 6.0.x | ||
- run: dotnet workload install maui | ||
- name: Import test certificate | ||
id: import-pfx | ||
run: | | ||
$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}") | ||
echo "::set-output name=thumbprint::$($cert.Thumbprint)" | ||
shell: powershell | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.nuget/packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('Tests/Tests.Maui/*.csproj') }} | ||
- name: Publish Tests/Tests.Maui | ||
run: dotnet publish Tests/Tests.Maui -c Release -f net6.0-windows10.0.19041 -r win10-x64 -p:GenerateAppxPackageOnBuild=true -p:PackageCertificateThumbprint=${{ steps.import-pfx.outputs.thumbprint }} -p:AppxPackageTestDir=Output/ -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} --no-self-contained | ||
- name: Output executable path | ||
id: dotnet-publish | ||
run: echo '::set-output name=executable-path::./Tests/Tests.Maui/bin/Release/net6.0-windows10.0.19041/win10-x64' | ||
- name: Deploy | ||
run: .\Tests\Tests.Maui\Output\Install.ps1 -Force | ||
- name: Run | ||
run: Tests.Maui.exe --headless --labels=After --result=TestResults.Windows.xml --baasurl=${{ secrets.BaseUrl }} --baascluster=${{ inputs.clusterName }} --baasapikey=${{ secrets.AtlasPublicKey}} --baasprivateapikey=${{ secrets.AtlasPrivateKey}} --baasprojectid=${{ secrets.AtlasProjectId }} --baasdifferentiator=Maui.Windows | ||
- name: Publish Unit Test Results | ||
uses: LaPeste/test-reporter@b8a650f4490e7472b930f56bbb92c7b42dc5db15 | ||
if: always() | ||
with: | ||
name: Results Maui.Windows | ||
path: TestResults.Windows.xml | ||
reporter: java-junit | ||
list-suites: failed | ||
list-tests: failed | ||
path-replace-backslashes: true | ||
fail-on-error: false |
Oops, something went wrong.