Skip to content

Commit

Permalink
Update to .net 8 (#3586)
Browse files Browse the repository at this point in the history
* Update to .net 8

* Fix some tfms

* More tfm fixes

* Update apple workflows to run with latest xcode

* Setup xcode

* Disable caching

* Use macos-13

* Use iphone 15

* Enable the intepreter for apple platforms on maui

* Revert "Enable the intepreter for apple platforms on maui"

This reverts commit c157d5d.

* Run transforms outside of the test

* Rename the android test results to something more normal

* Use bash for xslt transform

* Try to fix android paths, update simulator action

* Fix warnings

* Update ci-actions commit sha

* Setup dotnet for weaver tests

* fix some test conditions

* Add controls package

* Bring back UseMaui

* Disable failing test on android
  • Loading branch information
nirinchev committed Apr 30, 2024
1 parent 2122b58 commit 66f54a1
Show file tree
Hide file tree
Showing 54 changed files with 224 additions and 202 deletions.
3 changes: 2 additions & 1 deletion .github/actions/run-android-device-farm-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ runs:
Customer Artifacts.zip
- run: |
Expand-Archive 'Customer Artifacts.zip' -DestinationPath artifacts
echo "results-path=${{ github.workspace }}/artifacts/Host_Machine_Files/`$DEVICEFARM_LOG_DIR/TestResults.Android.xml" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
Move-Item -Path artifacts/Host_Machine_Files/`$DEVICEFARM_LOG_DIR/TestResults.Android.xml -Destination TestResults.Android.xml
echo "results-path=TestResults.Android.xml" | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append
name: Fetch test artifacts
shell: pwsh
id: get-test-results
Expand Down
2 changes: 1 addition & 1 deletion .github/templates/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Invoke-WebRequest -Uri https://github.com/dotnet/docfx/releases/download/v2.75.2/docfx-win-x64-v2.75.2.zip -OutFile C:\docfx.zip
Expand-Archive -Path C:\docfx.zip -DestinationPath C:\docfx
shell: powershell
- _: #@ template.replace(setupDotnet("7.0.x", ifCondition = "inputs.build-docs"))
- _: #@ template.replace(setupDotnet(ifCondition = "inputs.build-docs"))
- name: Build docs
if: inputs.build-docs
env:
Expand Down
20 changes: 10 additions & 10 deletions .github/templates/common.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
#@ actionUploadArtifact = "actions/upload-artifact@v3"
#@ actionDownloadArtifact = "actions/download-artifact@v3"
#@ actionSetupMSBuild = "microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497"
#@ actionSetupDotnet = "actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a"
#@ actionSetupDotnet = "actions/setup-dotnet@3e6b9fe3930cac7c59c651af5de1514b47a805b9" #! 4.0.0
#@ actionCodeQLInit = "github/codeql-action/init@40542d38bc4936c2ca7da883aeb050a6081b4b31"
#@ actionCodeQLAnalyze = "github/codeql-action/analyze@40542d38bc4936c2ca7da883aeb050a6081b4b31"
#@ actionSetupNode = "actions/setup-node@16352bb09bc672a073e326c2cc1d3d7d2a3e577e"
#@ actionAWSConfigureCredentials = "aws-actions/configure-aws-credentials@v1-node16"
#@ actionRuniOSSimulator = "realm/ci-actions/run-ios-simulator@fa20eb972b9f018654fdb4e2c7afb52b0532f907"
#@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@fa20eb972b9f018654fdb4e2c7afb52b0532f907"
#@ actionSetupXcode = "maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98"
#@ actionRuniOSSimulator = "realm/ci-actions/run-ios-simulator@6418e15ed9bbdb19b7d456a347e5623779f95cdf"
#@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@6418e15ed9bbdb19b7d456a347e5623779f95cdf"
#@ actionSetupXcode = "maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd"
#@ actionSetupAndroid = "android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc"
#@ actionSetupJDK = "actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0"

Expand Down Expand Up @@ -190,7 +190,7 @@ with:
if-no-files-found: error
#@ end
---
#@ def setupDotnet(version = "6.0.x", ifCondition = ""):
#@ def setupDotnet(version = "8.0.x", ifCondition = ""):
name: Configure .NET
uses: #@ actionSetupDotnet
#@ if (ifCondition != ""):
Expand All @@ -201,10 +201,10 @@ with:
#@ end
---
#@ def setupXcode(version = "14.0.1"):
- name: Setup Xcode
uses: #@ actionSetupXcode
with:
xcode-version: #@ version
name: Setup Xcode
uses: #@ actionSetupXcode
with:
xcode-version: #@ version
#@ end
---
#@ def uploadToNpm(tag = "latest", versionExpression = "steps.get-version.outputs.version", expectShortPath = False):
Expand All @@ -231,7 +231,7 @@ with:
#@ end
---
#@ def setupWorkloads(workloads = 'maui'):
- _: #@ template.replace(setupDotnet("7.0.x"))
- _: #@ template.replace(setupDotnet())
- name: Setup workloads
run: #@ "dotnet workload install " + workloads
#@ end
Expand Down
2 changes: 1 addition & 1 deletion .github/templates/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
_: #@ template.replace(buildUnity())
_: #@ template.replace(runTests(".NET Framework"))
_: #@ template.replace(runTests("UWP Managed", additionalSecrets = ["Pfx_Password", "Base64_Encoded_Pfx"]))
_: #@ template.replace(runNetCoreTests("[\"net6.0\", \"net7.0\"]"))
_: #@ template.replace(runNetCoreTests("[\"net6.0\", \"net8.0\"]"))
_: #@ template.replace(runTests("macOS"))
_: #@ template.replace(runTests("iOS"))
_: #@ template.replace(runTests("tvOS", runSyncTests = False))
Expand Down
2 changes: 1 addition & 1 deletion .github/templates/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
_: #@ template.replace(testUnity('["Mono-Net4"]', '[{ "os": "windows", "testPlatform": "Windows64" }, { "os": "linux", "testPlatform": "Linux64" }]'))
_: #@ template.replace(runTests(".NET Framework", runSyncTests = False))
_: #@ template.replace(runTests("UWP Managed", runSyncTests = False, additionalSecrets = ["Pfx_Password", "Base64_Encoded_Pfx"]))
_: #@ template.replace(runNetCoreTests('["net7.0"]'))
_: #@ template.replace(runNetCoreTests('["net8.0"]'))
_: #@ template.replace(runTests("macOS", runSyncTests = False))
_: #@ template.replace(runTests("iOS", runSyncTests = False))
_: #@ template.replace(runTests("tvOS", runSyncTests = False))
Expand Down
2 changes: 1 addition & 1 deletion .github/templates/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
* None
### Compatibility
* Realm Studio: 13.0.0 or later.
* Realm Studio: 15.0.0 or later.
### Internal
* Using Core x.y.z.
Expand Down
8 changes: 4 additions & 4 deletions .github/templates/test-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }}
device-pool-arn: ${{ secrets.DEVICEFARM_ANDROID_POOL_ARN }}
arguments: (@= baasTestArgs('android') @)
- #@ publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Xamarin.Android")
- #@ template.replace(publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Xamarin.Android"))
test-maui:
runs-on: windows-latest
name: Maui.Android
Expand All @@ -36,14 +36,14 @@ jobs:
- #@ template.replace(setupWorkloads())
- #@ setupJDK()
- name: Build the tests
run: #@ "dotnet publish Tests/Tests.Maui -c Release -f net6.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
run: #@ "dotnet publish Tests/Tests.Maui -c Release -f net8.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
- #@ template.replace(configureAWSCredentials("AWS_DEVICEFARM_ACCESS_KEY_ID", "AWS_DEVICEFARM_SECRET_ACCESS_KEY", "us-west-2"))
- name: Run the tests
uses: ./.github/actions/run-android-device-farm-test
id: run_tests
with:
apk-path: ${{ github.workspace }}/Tests/Tests.Maui/bin/Release/net6.0-android/publish/io.realm.mauitests-Signed.apk
apk-path: ${{ github.workspace }}/Tests/Tests.Maui/bin/Release/net8.0-android/publish/io.realm.mauitests-Signed.apk
app-id: io.realm.mauitests
project-arn: ${{ secrets.DEVICEFARM_PROJECT_ARN }}
device-pool-arn: ${{ secrets.DEVICEFARM_ANDROID_POOL_ARN }}
- #@ publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Maui.Android")
- #@ template.replace(publishTestsResults("${{ steps.run_tests.outputs.test-results-path }}", "Maui.Android", run_transform=True))
4 changes: 2 additions & 2 deletions .github/templates/test-code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
dotnet tool install coverlet.console --tool-path tools
dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
echo "${{ github.workspace }}/tools" >> $GITHUB_PATH
- #@ template.replace(dotnetPublish("Tests/Realm.Tests", "net7.0", "linux-x64", { "RealmTestsStandaloneExe": "true" }))
- #@ template.replace(dotnetPublish("Tests/Realm.Tests", "net8.0", "linux-x64", { "RealmTestsStandaloneExe": "true" }))
- name: Run the tests
env:
DOTNET_DbgEnableMiniDump: 1
Expand All @@ -39,4 +39,4 @@ jobs:
compare-sha: ${{ github.event.pull_request.base.sha }}
- name: Output Coveralls response
run: echo ${{ steps.publish-coveralls.outputs.coveralls-api-result }}
- #@ publishTestsResults("TestResults.Linux.xml", "Code Coverage")
- #@ template.replace(publishTestsResults("TestResults.Linux.xml", "Code Coverage"))
18 changes: 7 additions & 11 deletions .github/templates/test-ios.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator", "fetchPackageArtifacts", "setupWorkloads")
#@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator", "fetchPackageArtifacts", "setupWorkloads", "setupXcode")
#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest")

---
Expand All @@ -20,7 +20,7 @@ jobs:
bundleId: 'io.realm.dotnettests'
iphoneToSimulate: 'iPhone-8'
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.iOS.xml" + baasTestArgs("ios")
- #@ publishTestsResults("TestResults.iOS.xml", "Xamarin.iOS")
- #@ template.replace(publishTestsResults("TestResults.iOS.xml", "Xamarin.iOS"))

test-maui:
runs-on: macos-13
Expand All @@ -29,19 +29,15 @@ jobs:
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(fetchPackageArtifacts())
- name: Set XCode Version
shell: bash
run: |
sudo xcode-select -s "/Applications/Xcode_14.3.app"
echo "MD_APPLE_SDK_ROOT=/Applications/Xcode_14.3.app" >> $GITHUB_ENV
- #@ setupXcode("latest-stable")
- #@ template.replace(setupWorkloads())
- name: Build the tests
run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net6.0-ios -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net8.0-ios -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
- name: Run the tests
uses: #@ actionRuniOSSimulator
with:
appPath: #@ "Tests/Tests.Maui/bin/" + configuration + "/net6.0-ios/iossimulator-x64/Tests.Maui.app"
appPath: #@ "Tests/Tests.Maui/bin/" + configuration + "/net8.0-ios/iossimulator-x64/Tests.Maui.app"
bundleId: 'io.realm.mauitests'
iphoneToSimulate: 'iPhone-8'
iphoneToSimulate: 'iPhone-15'
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.iOS.xml --labels=After"
- #@ publishTestsResults("TestResults.iOS.xml", "Maui.iOS")
- #@ template.replace(publishTestsResults("TestResults.iOS.xml", "Maui.iOS", run_transform=True))
11 changes: 6 additions & 5 deletions .github/templates/test-macos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "checkoutCode", "configuration", "fetchPackageArtifacts", "setupWorkloads")
#@ load("common.lib.yml", "checkoutCode", "configuration", "fetchPackageArtifacts", "setupWorkloads", "setupXcode")
#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest")

---
Expand All @@ -15,17 +15,18 @@ jobs:
- #@ template.replace(buildTests("Tests/Tests.XamarinMac"))
- name: Run the tests
run: #@ "Tests/Tests.XamarinMac/bin/" + configuration + "/Tests.XamarinMac.app/Contents/MacOS/Tests.XamarinMac --headless --result=${{ github.workspace }}/TestResults.XamarinMac.xml --labels=All" + baasTestArgs("xamarinmacos")
- #@ publishTestsResults("TestResults.XamarinMac.xml", "Xamarin.macOS")
- #@ template.replace(publishTestsResults("TestResults.XamarinMac.xml", "Xamarin.macOS"))
test-maui:
runs-on: macos-13
name: Maui.MacCatalyst
timeout-minutes: 60
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(fetchPackageArtifacts())
- #@ setupXcode("latest-stable")
- #@ template.replace(setupWorkloads())
- name: Build the tests
run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net6.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
run: #@ "dotnet build Tests/Tests.Maui -c " + configuration + " -f net8.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }}"
- name: Run the tests
run: #@ "Tests/Tests.Maui/bin/" + configuration + "/net6.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.MacCatalyst.xml --labels=All" + baasTestArgs("maccatalyst")
- #@ publishTestsResults("TestResults.MacCatalyst.xml", "Maui.MacCatalyst")
run: #@ "Tests/Tests.Maui/bin/" + configuration + "/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.MacCatalyst.xml --labels=All" + baasTestArgs("maccatalyst")
- #@ template.replace(publishTestsResults("TestResults.MacCatalyst.xml", "Maui.MacCatalyst", run_transform=True))
15 changes: 8 additions & 7 deletions .github/templates/test-net-core.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts")
#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts", "setupDotnet")
#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "dotnetBuildTests", "prepareTest")

---
Expand All @@ -22,21 +22,22 @@ jobs:
runtime: osx-x64
framework: ${{ fromJson(inputs.framework) }}
include:
- framework: net7.0
- framework: net8.0
os:
runner: macos-14
runtime: osx-arm64
- framework: net7.0
os:
runner: win81
runtime: win-x64
#! - framework: net6.0 // Need to install net8 sdk to the win81 runner
#! os:
#! runner: win81
#! runtime: win-x64

steps:
- #@ template.replace(prepareTest(cleanupWorkspace = True))
#! To avoid NU5037 error
- name: Clear nuget cache
run: dotnet nuget locals all --clear
if: ${{ matrix.os.runner == 'win81' }}
- _: #@ template.replace(setupDotnet())
- #@ template.replace(dotnetBuildTests("Tests/Realm.Tests", "${{ matrix.framework }}", "${{ matrix.os.runtime }}"))
- name: Run the tests
env:
Expand All @@ -49,4 +50,4 @@ jobs:
with:
name: crash-report-net-core-${{ matrix.runner }}-${{ matrix.runtime }}
path: /tmp/coredump*
- #@ publishTestsResults("TestResults.xml", ".NET (${{ matrix.os.runner }}, ${{ matrix.framework }})")
- #@ template.replace(publishTestsResults("TestResults.xml", ".NET (${{ matrix.os.runner }}, ${{ matrix.framework }})"))
2 changes: 1 addition & 1 deletion .github/templates/test-net-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- #@ template.replace(buildTests("Tests/Realm.Tests", TargetFramework="net461", RealmTestsStandaloneExe="true"))
- name: Run the tests
run: #@ "./Tests/Realm.Tests/bin/" + configuration + "/net461/Realm.Tests.exe --result=TestResults.Windows.xml --labels=After" + baasTestArgs("net-framework")
- #@ publishTestsResults("TestResults.Windows.xml", ".NET Framework")
- #@ template.replace(publishTestsResults("TestResults.Windows.xml", ".NET Framework"))
2 changes: 1 addition & 1 deletion .github/templates/test-source-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- #@ template.replace(dotnetPublish("Tests/SourceGenerators/Realm.SourceGenerator.Tests", "net6.0", "win-x64"))
- name: Run the tests
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/Realm.SourceGenerator.Tests --result=TestResults.SourceGeneration.xml"
- #@ publishTestsResults("TestResults.SourceGeneration.xml", "Source Generation")
- #@ template.replace(publishTestsResults("TestResults.SourceGeneration.xml", "Source Generation"))
2 changes: 1 addition & 1 deletion .github/templates/test-tvos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
iphoneToSimulate: 'Apple-TV-1080p'
arguments: #@ "--headless --result=${{ github.workspace }}/TestResults.tvOS.xml --labels=All" + baasTestArgs("tvos")
os: 'tvOS'
- #@ publishTestsResults("TestResults.tvOS.xml", "Xamarin.tvOS")
- #@ template.replace(publishTestsResults("TestResults.tvOS.xml", "Xamarin.tvOS"))
4 changes: 2 additions & 2 deletions .github/templates/test-unity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: |
chmod +x ${{ github.workspace }}/TestRunner/PlayerWithTests.x86_64
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' ${{ github.workspace }}/TestRunner/PlayerWithTests.x86_64 -logFile - --result=${{ github.workspace }}/TestResults.xml
- #@ publishTestsResults("TestResults.xml", "Unity Linux Mono_Net4")
- #@ template.replace(publishTestsResults("TestResults.xml", "Unity Linux Mono_Net4"))

run-tests-windows:
runs-on: windows-latest
Expand All @@ -93,4 +93,4 @@ jobs:
Start-Process ${{ github.workspace }}\TestRunner\PlayerWithTests.exe -Wait -ArgumentList "-logFile","${{ github.workspace }}\test.log","--result=${{ github.workspace }}\TestResults.xml"
cat ${{ github.workspace }}\test.log
shell: powershell
- #@ publishTestsResults("TestResults.xml", "Unity Windows Mono_Net4")
- #@ template.replace(publishTestsResults("TestResults.xml", "Unity Windows Mono_Net4"))
2 changes: 1 addition & 1 deletion .github/templates/test-uwp-managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
- name: Run the tests
run: #@ "./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs '" + baasTestArgs("uwp-managed") + "'"
shell: powershell
- #@ publishTestsResults("${{ env.TEST_RESULTS }}", "UWP Managed")
- #@ template.replace(publishTestsResults("${{ env.TEST_RESULTS }}", "UWP Managed"))
4 changes: 2 additions & 2 deletions .github/templates/test-weaver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(setupWorkloads("android ${{ (matrix.os.runner != 'ubuntu-latest' && 'tvos ios maccatalyst') || '' }}"))
- _: #@ template.replace(setupDotnet())
- _: #@ template.replace(setupDotnet("6.0.x"))
- #@ template.replace(dotnetPublish("Tests/Weaver/Realm.Fody.Tests", "net6.0", "${{ matrix.os.runtime }}"))
- name: Run Tests
run: ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Fody.Tests --result=TestResults.Weaver.xml --labels=After
- #@ publishTestsResults("TestResults.Weaver.xml", "Weaver ${{ matrix.os.runtime }}")
- #@ template.replace(publishTestsResults("TestResults.Weaver.xml", "Weaver ${{ matrix.os.runtime }}"))
4 changes: 2 additions & 2 deletions .github/templates/test-woven-classes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- #@ template.replace(checkoutCode())
- #@ template.replace(fetchPackageArtifacts())
- #@ template.replace(wovenClassesBuildTests("Tests/Realm.Tests", "net7.0", "win-x64"))
- #@ template.replace(wovenClassesBuildTests("Tests/Realm.Tests", "net8.0", "win-x64"))
- name: Run the tests
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests --result=TestResults.WovenClasses.xml --labels=After"
- #@ publishTestsResults("TestResults.WovenClasses.xml", "Woven classes")
- #@ template.replace(publishTestsResults("TestResults.WovenClasses.xml", "Woven classes"))
31 changes: 19 additions & 12 deletions .github/templates/test.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@
#@ return " --baasaas-api-key=${{ secrets.BaaSaasApiKey}} --baas-differentiator=" + differentiator + "-${{ github.run_id }}-${{ github.run_attempt }}"
#@ end
---
#@ def publishTestsResults(files, test_title):
name: Publish Unit Test Results
uses: LaPeste/test-reporter@510caf50a955b1003bec48a6494be4d6537f3a0b
if: always()
with:
name: #@ "Results " + test_title
path: #@ files
reporter: java-junit
list-suites: failed
list-tests: failed
path-replace-backslashes: true
fail-on-error: false
#@ def publishTestsResults(file, test_title, run_transform=False):
#@ output_file = file
#@ if run_transform:
#@ output_file = file + "_transformed.xml"
- name: Transform Results
run: #@ "xsltproc --output " + output_file + " Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt " + file
shell: bash
#@ end
- name: Publish Unit Test Results
uses: LaPeste/test-reporter@510caf50a955b1003bec48a6494be4d6537f3a0b
if: always()
with:
name: #@ "Results " + test_title
path: #@ output_file
reporter: java-junit
list-suites: failed
list-tests: failed
path-replace-backslashes: true
fail-on-error: false
#@ end
---
#@ def testDefinition(additionalSecrets = [], additionalInputs = []):
Expand Down

0 comments on commit 66f54a1

Please sign in to comment.