From 6e1c22b431c187c8e956b7206de0dd2532dfb3e3 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Mon, 19 Aug 2024 16:25:49 +0200 Subject: [PATCH] Fix gha workflows --- .github/pkl-workflows/helpers/BaaS.pkl | 47 ---------- .github/pkl-workflows/helpers/Common.pkl | 21 ++--- .github/pkl-workflows/helpers/Test.pkl | 52 +++-------- .github/pkl-workflows/main.pkl | 12 +-- .github/pkl-workflows/pr.pkl | 6 +- .github/pkl-workflows/publish-release.pkl | 2 +- .github/workflows/main.yml | 105 ++-------------------- .github/workflows/pr.yml | 67 ++------------ .github/workflows/publish-release.yml | 8 -- 9 files changed, 37 insertions(+), 283 deletions(-) delete mode 100644 .github/pkl-workflows/helpers/BaaS.pkl diff --git a/.github/pkl-workflows/helpers/BaaS.pkl b/.github/pkl-workflows/helpers/BaaS.pkl deleted file mode 100644 index ae228a428a..0000000000 --- a/.github/pkl-workflows/helpers/BaaS.pkl +++ /dev/null @@ -1,47 +0,0 @@ -module baas - -import "../GithubAction/GithubAction.pkl" as gha -import "Common.pkl" -import "Steps.pkl" - -function deploy(differentiators: Listing): gha.MatrixJob = new { - name = "Deploy BaaS" - `runs-on` = new gha.UbuntuLatest{} - strategy { - matrix { - ["differentiator"] = differentiators - } - } - `if` = Common.ifNotCanceledCondition - steps { - ...Steps.checkout(false) - Steps.setupDotnet("8.0.x") - ...deployStep("${{ matrix.differentiator }}", true) - } -} - -function deployStep(differentiator: Common.SyncDifferentiator?, shouldDeploy: Boolean): List = if (shouldDeploy && differentiator != null) List(new gha.Step { - name = "Deploy Apps" - run = "dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=\(differentiator)-${{ github.run_id }}-${{ github.run_attempt }}" - `working-directory` = "Tools/DeployApps" -}) else List() - -function cleanup(differentiators: Listing): gha.MatrixJob = new { - name = "Cleanup BaaS" - `runs-on` = new gha.UbuntuLatest{} - strategy { - matrix { - ["differentiator"] = differentiators - } - } - `if` = Common.ifNotCanceledCondition - steps { - ...Steps.checkout(false) - Steps.setupDotnet("8.0.x") - new { - name = "Terminate Baas" - run = "dotnet run terminate-baas --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=${{ matrix.differentiator }}-${{ github.run_id }}-${{ github.run_attempt }}" - `working-directory` = "Tools/DeployApps" - } - } -} \ No newline at end of file diff --git a/.github/pkl-workflows/helpers/Common.pkl b/.github/pkl-workflows/helpers/Common.pkl index 7b013bed94..b19abd7a3a 100644 --- a/.github/pkl-workflows/helpers/Common.pkl +++ b/.github/pkl-workflows/helpers/Common.pkl @@ -1,7 +1,6 @@ module common import "../GithubAction/GithubAction.pkl" as gha -import "BaaS.pkl" import "Lint.pkl" import "Package.pkl" import "Test.pkl" as TestJobs @@ -50,12 +49,11 @@ const packages: List = nugetPackages + List("Realm.UnityUtils", "Realm.U const testTimeout: Int = 60 -const function defaultBuildJobs(baasDifferentiators: Listing, netCoreVersions: Listing): Mapping = new { +const function defaultBuildJobs(netCoreVersions: Listing): Mapping = new { [job_Wrappers] = new gha.ReusableWorkflowJob { uses = "./.github/workflows/wrappers.yml" name = "Wrappers" } - [job_Baas] = BaaS.deploy(baasDifferentiators) [job_Packages] = (Package.nuget("contains(github.head_ref, 'release')")){ needs { job_Wrappers @@ -68,23 +66,20 @@ const function defaultBuildJobs(baasDifferentiators: Listing ...TestJobs.unity(new TestJobs.UnityTestConfig { os = "windows" }) - ["test-net-framework"] = TestJobs.netFramework(baasDifferentiators) - ["test-uwp"] = TestJobs.uwp(baasDifferentiators) + ["test-net-framework"] = TestJobs.netFramework() + ["test-uwp"] = TestJobs.uwp() ["test-net-core"] = TestJobs.netCore(netCoreVersions) ["test-macos-xamarin"] = TestJobs.macOS_Xamarin() - ["test-macos-maui"] = TestJobs.macOS_Maui(baasDifferentiators) + ["test-macos-maui"] = TestJobs.macOS_Maui() ["test-ios-xamarin"] = TestJobs.iOS_Xamarin() - ["test-ios-maui"] = TestJobs.iOS_Maui(baasDifferentiators) - ["test-tvos"] = TestJobs.tvOS(baasDifferentiators) + ["test-ios-maui"] = TestJobs.iOS_Maui() + ["test-tvos"] = TestJobs.tvOS() ["test-android-xamarin"] = TestJobs.android_Xamarin() - ["test-android-maui"] = TestJobs.android_Maui(baasDifferentiators) + ["test-android-maui"] = TestJobs.android_Maui() ["test-woven-classes"] = TestJobs.wovenClasses() ["test-source-generation"] = TestJobs.sourceGeneration() ["test-weaver"] = TestJobs.weaver() - ["test-code-coverage"] = TestJobs.codeCoverage(job_Wrappers, baasDifferentiators) - ["cleanup-baas"] = (BaaS.cleanup(baasDifferentiators)) { - needs = baasDifferentiators.toList().map((d) -> "test-\(d)").toListing() - } + ["test-code-coverage"] = TestJobs.codeCoverage(job_Wrappers) ["verify-namespaces"] = Lint.verifyNamespaces() ["lint"] = Lint.lint() } diff --git a/.github/pkl-workflows/helpers/Test.pkl b/.github/pkl-workflows/helpers/Test.pkl index 7b6dcc7c0b..879e33d434 100644 --- a/.github/pkl-workflows/helpers/Test.pkl +++ b/.github/pkl-workflows/helpers/Test.pkl @@ -3,7 +3,6 @@ module test import "../GithubAction/GithubAction.pkl" as gha import "Common.pkl" import "Steps.pkl" -import "BaaS.pkl" import "Package.pkl" local const actionReportTestResults = "dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5" @@ -12,12 +11,10 @@ local const outputFile = "TestResults.xml" local const executableExpression = "${{ steps.dotnet-publish.outputs.executable-path }}" // Public test targets -function netFramework(_syncDifferentiators: Listing): gha.StepJobBase = testJob( +function netFramework(): gha.StepJobBase = testJob( new TestConfig { title = ".NET Framework" needsPackages = true - syncDifferentiator = "net-framework" - syncDifferentiators = _syncDifferentiators }, new gha.WindowsLatest{}, null, @@ -34,7 +31,7 @@ function netFramework(_syncDifferentiators: Listing): gha.StepJobBase = }) new { name = "Run the tests" - run = "./Tests/Realm.Tests/bin/\(Common.configuration)/net461/Realm.Tests.exe --result=\(outputFile) --labels=After \(baasTestArgs(config))" + run = "./Tests/Realm.Tests/bin/\(Common.configuration)/net461/Realm.Tests.exe --result=\(outputFile) --labels=After" } ...reportTestResults(config) }) @@ -155,12 +152,10 @@ function wovenClasses(): gha.StepJobBase = testJob( } ) -function tvOS(_syncDifferentiators: Listing): gha.StepJobBase = testJob( +function tvOS(): gha.StepJobBase = testJob( new TestConfig { needsPackages = true title = "Xamarin.tvOS" - syncDifferentiator = "tvos" - syncDifferentiators = _syncDifferentiators }, "macos-12", null, @@ -176,7 +171,7 @@ function tvOS(_syncDifferentiators: Listing): gha.Ste }) Steps.runSimulator(new Steps.SimulatorConfig{ appPath = "Tests/Tests.XamarinTVOS/bin/iPhoneSimulator/\(Common.configuration)/Tests.XamarinTVOS.app" - arguments = "--headless --result=${{ github.workspace }}/\(outputFile) --labels=All \(baasTestArgs(config))" + arguments = "--headless --result=${{ github.workspace }}/\(outputFile) --labels=All" bundleId = "io.realm.Tests-XamarinTVOS" iphoneToSimulate = "Apple-TV-1080p" os = "tvOS" @@ -203,7 +198,7 @@ function iOS_Xamarin(): gha.StepJobBase = testJob( }) Steps.runSimulator(new Steps.SimulatorConfig{ appPath = "Tests/Tests.iOS/bin/iPhoneSimulator/\(Common.configuration)/Tests.iOS.app" - arguments = "--headless --result=${{ github.workspace }}/\(outputFile) --labels=All \(baasTestArgs(config))" + arguments = "--headless --result=${{ github.workspace }}/\(outputFile) --labels=All " bundleId = "io.realm.dotnettests" iphoneToSimulate = "iPhone-8" os = "iOS" @@ -211,12 +206,10 @@ function iOS_Xamarin(): gha.StepJobBase = testJob( ...reportTestResults(config) }) -function iOS_Maui(_syncDifferentiators: Listing): gha.StepJobBase = testJob( +function iOS_Maui(): gha.StepJobBase = testJob( new TestConfig { needsPackages = true title = "Maui.iOS" - syncDifferentiator = "ios-maui" - syncDifferentiators = _syncDifferentiators transformResults = true }, "macos-13", @@ -228,7 +221,7 @@ function iOS_Maui(_syncDifferentiators: Listing): gha Steps.dotnetBuild("Tests/Tests.Maui", "net8.0-ios", null, getTestProps(false)) Steps.runSimulator(new Steps.SimulatorConfig{ appPath = "Tests/Tests.Maui/bin/\(Common.configuration)/net8.0-ios/iossimulator-x64/Tests.Maui.app" - arguments = "--headless --result=${{ github.workspace }}/\(outputFile) --labels=All \(baasTestArgs(config))" + arguments = "--headless --result=${{ github.workspace }}/\(outputFile) --labels=All" bundleId = "io.realm.mauitests" iphoneToSimulate = "iPhone-15" os = "iOS" @@ -257,12 +250,10 @@ function macOS_Xamarin(): gha.StepJobBase = testJob( ...reportTestResults(config) }) -function macOS_Maui(_syncDifferentiators: Listing): gha.StepJobBase = testJob( +function macOS_Maui(): gha.StepJobBase = testJob( new TestConfig { needsPackages = true title = "Maui.MacCatalyst" - syncDifferentiator = "macos-maui" - syncDifferentiators = _syncDifferentiators transformResults = true }, "macos-13", @@ -274,17 +265,15 @@ function macOS_Maui(_syncDifferentiators: Listing): g Steps.dotnetBuild("Tests/Tests.Maui", "net8.0-maccatalyst", null, getTestProps(false)) new { name = "Run the tests" - run = "Tests/Tests.Maui/bin/\(Common.configuration)/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/\(outputFile) --labels=All \(baasTestArgs(config))" + run = "Tests/Tests.Maui/bin/\(Common.configuration)/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/\(outputFile) --labels=All" } ...reportTestResults(config) }) -function uwp(_syncDifferentiators: Listing): gha.StepJobBase = testJob( +function uwp(): gha.StepJobBase = testJob( new TestConfig { needsPackages = true title = "UWP" - syncDifferentiators = _syncDifferentiators - syncDifferentiator = "uwp" }, new gha.WindowsLatest{}, null, @@ -314,7 +303,7 @@ function uwp(_syncDifferentiators: Listing): gha.Step }) new { name = "Run the tests" - run = "./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs '\(baasTestArgs(config))'" + run = "./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs" shell = "powershell" } ...reportTestResultsWithCustomFile("${{ env.TEST_RESULTS }}", config) @@ -347,12 +336,10 @@ function android_Xamarin(): gha.StepJobBase = testJob( ...reportTestResultsWithCustomFile("${{ steps.run_tests.outputs.test-results-path }}", config) }) -function android_Maui(_syncDifferentiators: Listing): gha.StepJobBase = testJob( +function android_Maui(): gha.StepJobBase = testJob( new TestConfig { needsPackages = true title = "Maui.Android" - syncDifferentiator = "android-maui" - syncDifferentiators = _syncDifferentiators transformResults = true }, new gha.WindowsLatest{}, @@ -369,11 +356,9 @@ function android_Maui(_syncDifferentiators: Listing): ...reportTestResultsWithCustomFile("${{ steps.run_tests.outputs.test-results-path }}", config) }) -function codeCoverage(wrappersJob: String, _syncDifferentiators: Listing): gha.StepJobBase = (testJob( +function codeCoverage(wrappersJob: String): gha.StepJobBase = (testJob( new TestConfig { title = "Code Coverage" - syncDifferentiator = "code-coverage" - syncDifferentiators = _syncDifferentiators usedWrappers = List("linux-x86_64") }, new gha.UbuntuLatest{}, @@ -391,7 +376,7 @@ function codeCoverage(wrappersJob: String, _syncDifferentiators: Listing enableCoreDumps(true) archiveCoreDump() ...Steps.publishCoverage("./report.lcov") @@ -531,9 +516,6 @@ local function testJob(config: TestConfig, runsOn: gha.Machine | String, _strate when (config.needsPackages) { needs { Common.job_Packages - when (config.runSyncTests) { - Common.job_Baas - } } } `if` = Common.ifNotCanceledCondition @@ -545,7 +527,6 @@ local function prepareTests(config: TestConfig(needsPackages == true || !usedWra ...Steps.checkout(false) ...cleanWorkspace(config.shouldCleanWorkspace) ...fetchTestArtifacts(config.usedWrappers) - ...BaaS.deployStep(config.syncDifferentiator, config.runSyncTests) } local function cleanWorkspace(shouldClean: Boolean): Listing = new Listing { @@ -564,8 +545,6 @@ local function buildTests(config: Steps.MSBuildConfig): Listing = Step } }) -local function baasTestArgs(config: TestConfig): String = if (config.runSyncTests) " --baasaas-api-key=${{ secrets.BAASAAS_API_KEY}} --baas-differentiator=\(config.syncDifferentiator)-${{ github.run_id }}-${{ github.run_attempt }}" else "" - local function reportTestResults(config: TestConfig): Listing = reportTestResultsWithCustomFile(outputFile, config) local function reportTestResultsWithCustomFile(_outputFile: String, config: TestConfig): Listing = new { @@ -637,8 +616,5 @@ local class TestConfig { needsPackages: Boolean = false usedWrappers: List(every((wrapper) -> Common.wrapperBinaryNames.contains(wrapper))) shouldCleanWorkspace: Boolean = false - syncDifferentiator: Common.SyncDifferentiator? = null transformResults: Boolean = false - syncDifferentiators: Listing? - runSyncTests: Boolean = syncDifferentiator != null && (syncDifferentiators?.toList()?.contains(syncDifferentiator) ?? false) } diff --git a/.github/pkl-workflows/main.pkl b/.github/pkl-workflows/main.pkl index 20e7df3ca8..c721c84f04 100644 --- a/.github/pkl-workflows/main.pkl +++ b/.github/pkl-workflows/main.pkl @@ -6,16 +6,6 @@ import "helpers/Common.pkl" import "helpers/Steps.pkl" import "helpers/Test.pkl" as TestJobs -local baasDifferentiators: Listing = new { - "code-coverage" - "net-framework" - "uwp" - "macos-maui" - "android-maui" - "ios-maui" - "macos-maui" -} - local netCoreFrameworks: Listing = new { "net6.0" "net8.0" @@ -46,7 +36,7 @@ on { env = Common.defaultEnv -jobs = (Common.defaultBuildJobs(baasDifferentiators, netCoreFrameworks)) { +jobs = (Common.defaultBuildJobs(netCoreFrameworks)) { ["publish-packages-to-sleet"] = new Job { `runs-on` = new UbuntuLatest{} name = "Publish package to S3" diff --git a/.github/pkl-workflows/pr.pkl b/.github/pkl-workflows/pr.pkl index 3f8de3eaef..684673dcae 100644 --- a/.github/pkl-workflows/pr.pkl +++ b/.github/pkl-workflows/pr.pkl @@ -4,10 +4,6 @@ amends "GithubAction/GithubAction.pkl" import "helpers/Common.pkl" -local baasDifferentiators: Listing = new { - "code-coverage" -} - local netCoreFrameworks: Listing = new { "net6.0" } @@ -41,4 +37,4 @@ concurrency { `cancel-in-progress` = true } -jobs = Common.defaultBuildJobs(baasDifferentiators, netCoreFrameworks) \ No newline at end of file +jobs = Common.defaultBuildJobs(netCoreFrameworks) \ No newline at end of file diff --git a/.github/pkl-workflows/publish-release.pkl b/.github/pkl-workflows/publish-release.pkl index e4023f8cc3..40110af234 100644 --- a/.github/pkl-workflows/publish-release.pkl +++ b/.github/pkl-workflows/publish-release.pkl @@ -21,7 +21,7 @@ jobs { Steps.downloadAllArtifacts() Steps.readVersionFromPackage() Steps.configureAWSCredentials("DOCS_S3_ACCESS_KEY", "DOCS_S3_SECRET_KEY", "us-east-2") - uploadDocs() +// uploadDocs() ...uploadToNuGet() ...Steps.uploadToNPM("latest") ...mergeReleasePR() diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92b2880a4c..0e252418eb 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,37 +23,6 @@ jobs: build-wrappers: name: Wrappers uses: ./.github/workflows/wrappers.yml - deploy-baas: - name: Deploy BaaS - if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - submodules: false - ref: ${{ github.event.pull_request.head.sha }} - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/csc.json" - echo "::add-matcher::.github/problem-matchers/msvc.json" - - uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59 - with: - dotnet-version: 8.0.x - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=${{ matrix.differentiator }}-${{ github.run_id }}-${{ github.run_attempt }} - strategy: - matrix: - differentiator: - - code-coverage - - net-framework - - uwp - - macos-maui - - android-maui - - ios-maui - - macos-maui - fail-fast: false build-packages: name: Package NuGet needs: @@ -511,7 +480,6 @@ jobs: name: Test .NET Framework needs: - build-packages - - deploy-baas if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') timeout-minutes: 60 runs-on: windows-latest @@ -535,16 +503,13 @@ jobs: with: name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=net-framework-${{ github.run_id }}-${{ github.run_attempt }} - name: Add msbuild to PATH if: ${{ runner.os == 'Windows' }} uses: microsoft/setup-msbuild@70b70342ae97ca98d5eaad06cafd26d30f9592a9 - name: Build Tests/Realm.Tests run: msbuild Tests/Realm.Tests -restore -p:Configuration=Release -p:TargetFramework=net461 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true - name: Run the tests - run: ./Tests/Realm.Tests/bin/Release/net461/Realm.Tests.exe --result=TestResults.xml --labels=After --baasaas-api-key=${{ secrets.BAASAAS_API_KEY}} --baas-differentiator=net-framework-${{ github.run_id }}-${{ github.run_attempt }} + run: ./Tests/Realm.Tests/bin/Release/net461/Realm.Tests.exe --result=TestResults.xml --labels=After - name: Publish Unit Test Results if: always() uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 @@ -559,7 +524,6 @@ jobs: name: Test UWP needs: - build-packages - - deploy-baas if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') timeout-minutes: 60 runs-on: windows-latest @@ -583,9 +547,6 @@ jobs: with: name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=uwp-${{ github.run_id }}-${{ github.run_attempt }} - name: Import test certificate run: |- $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") @@ -599,7 +560,7 @@ jobs: - name: Build Tests/Tests.UWP run: msbuild Tests/Tests.UWP -restore -p:Configuration=Release -p:AppxBundle=Always -p:PackageCertificateKeyFile=${{ github.workspace }}\Tests\Tests.UWP\Tests.UWP_TemporaryKey.pfx -p:PackageCertificatePassword=${{ secrets.Pfx_Password }} -p:UseDotNetNativeToolchain=false -p:AppxBundlePlatforms=x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} - name: Run the tests - run: ./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs ' --baasaas-api-key=${{ secrets.BAASAAS_API_KEY}} --baas-differentiator=uwp-${{ github.run_id }}-${{ github.run_attempt }}' + run: ./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs shell: powershell - name: Publish Unit Test Results if: always() @@ -747,7 +708,6 @@ jobs: name: Test Maui.MacCatalyst needs: - build-packages - - deploy-baas if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') timeout-minutes: 60 runs-on: macos-13 @@ -771,9 +731,6 @@ jobs: with: name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=macos-maui-${{ github.run_id }}-${{ github.run_attempt }} - uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59 with: dotnet-version: 8.0.x @@ -786,7 +743,7 @@ jobs: - name: Build Tests/Tests.Maui run: dotnet build Tests/Tests.Maui -c Release -f net8.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} - name: Run the tests - run: Tests/Tests.Maui/bin/Release/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.xml --labels=All --baasaas-api-key=${{ secrets.BAASAAS_API_KEY}} --baas-differentiator=macos-maui-${{ github.run_id }}-${{ github.run_attempt }} + run: Tests/Tests.Maui/bin/Release/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.xml --labels=All - name: Transform Results run: xsltproc --output TestResults.xml_transformed.xml Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt TestResults.xml - name: Publish Unit Test Results @@ -853,7 +810,6 @@ jobs: name: Test Maui.iOS needs: - build-packages - - deploy-baas if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') timeout-minutes: 60 runs-on: macos-13 @@ -877,9 +833,6 @@ jobs: with: name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=ios-maui-${{ github.run_id }}-${{ github.run_attempt }} - uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59 with: dotnet-version: 8.0.x @@ -897,7 +850,7 @@ jobs: appPath: Tests/Tests.Maui/bin/Release/net8.0-ios/iossimulator-x64/Tests.Maui.app bundleId: io.realm.mauitests iphoneToSimulate: iPhone-15 - arguments: --headless --result=${{ github.workspace }}/TestResults.xml --labels=All --baasaas-api-key=${{ secrets.BAASAAS_API_KEY}} --baas-differentiator=ios-maui-${{ github.run_id }}-${{ github.run_attempt }} + arguments: --headless --result=${{ github.workspace }}/TestResults.xml --labels=All os: iOS - name: Transform Results run: xsltproc --output TestResults.xml_transformed.xml Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt TestResults.xml @@ -949,7 +902,7 @@ jobs: appPath: Tests/Tests.XamarinTVOS/bin/iPhoneSimulator/Release/Tests.XamarinTVOS.app bundleId: io.realm.Tests-XamarinTVOS iphoneToSimulate: Apple-TV-1080p - arguments: '--headless --result=${{ github.workspace }}/TestResults.xml --labels=All ' + arguments: --headless --result=${{ github.workspace }}/TestResults.xml --labels=All os: tvOS - name: Publish Unit Test Results if: always() @@ -1026,7 +979,6 @@ jobs: name: Test Maui.Android needs: - build-packages - - deploy-baas if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') timeout-minutes: 60 runs-on: windows-latest @@ -1055,9 +1007,6 @@ jobs: with: name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=android-maui-${{ github.run_id }}-${{ github.run_attempt }} - uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59 with: dotnet-version: 8.0.x @@ -1248,9 +1197,6 @@ jobs: with: name: wrappers-linux-x86_64 path: wrappers/build - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=code-coverage-${{ github.run_id }}-${{ github.run_attempt }} - name: Setup Coverlet & Report Generator run: |- dotnet tool install coverlet.console --tool-path tools @@ -1266,7 +1212,7 @@ jobs: env: DOTNET_DbgEnableMiniDump: 1 DOTNET_EnableCrashReport: 1 - run: ./tools/coverlet ./Tests/Realm.Tests/bin/Release/net8.0/linux-x64 -t ${{ steps.dotnet-publish.outputs.executable-path }} -a '--result=TestResults.xml --labels=After --baasaas-api-key=${{ secrets.BAASAAS_API_KEY}} --baas-differentiator=code-coverage-${{ github.run_id }}-${{ github.run_attempt }}' -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*' --exclude '[Realm.PlatformHelpers]*' + run: ./tools/coverlet ./Tests/Realm.Tests/bin/Release/net8.0/linux-x64 -t ${{ steps.dotnet-publish.outputs.executable-path }} -a '--result=TestResults.xml --labels=After' -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*' --exclude '[Realm.PlatformHelpers]*' - name: Archive core dump if: ${{ failure() && runner.os != 'Windows' }} uses: actions/upload-artifact@v4 @@ -1295,45 +1241,6 @@ jobs: list-suites: failed path-replace-backslashes: true fail-on-error: true - cleanup-baas: - name: Cleanup BaaS - needs: - - test-code-coverage - - test-net-framework - - test-uwp - - test-macos-maui - - test-android-maui - - test-ios-maui - - test-macos-maui - if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - submodules: false - ref: ${{ github.event.pull_request.head.sha }} - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/csc.json" - echo "::add-matcher::.github/problem-matchers/msvc.json" - - uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59 - with: - dotnet-version: 8.0.x - - name: Terminate Baas - working-directory: Tools/DeployApps - run: dotnet run terminate-baas --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=${{ matrix.differentiator }}-${{ github.run_id }}-${{ github.run_attempt }} - strategy: - matrix: - differentiator: - - code-coverage - - net-framework - - uwp - - macos-maui - - android-maui - - ios-maui - - macos-maui - fail-fast: false verify-namespaces: name: Verify Namespaces needs: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 755fcbe25f..6d66070185 100755 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -29,31 +29,6 @@ jobs: build-wrappers: name: Wrappers uses: ./.github/workflows/wrappers.yml - deploy-baas: - name: Deploy BaaS - if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - submodules: false - ref: ${{ github.event.pull_request.head.sha }} - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/csc.json" - echo "::add-matcher::.github/problem-matchers/msvc.json" - - uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59 - with: - dotnet-version: 8.0.x - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=${{ matrix.differentiator }}-${{ github.run_id }}-${{ github.run_attempt }} - strategy: - matrix: - differentiator: - - code-coverage - fail-fast: false build-packages: name: Package NuGet needs: @@ -540,7 +515,7 @@ jobs: - name: Build Tests/Realm.Tests run: msbuild Tests/Realm.Tests -restore -p:Configuration=Release -p:TargetFramework=net461 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true - name: Run the tests - run: './Tests/Realm.Tests/bin/Release/net461/Realm.Tests.exe --result=TestResults.xml --labels=After ' + run: ./Tests/Realm.Tests/bin/Release/net461/Realm.Tests.exe --result=TestResults.xml --labels=After - name: Publish Unit Test Results if: always() uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 @@ -591,7 +566,7 @@ jobs: - name: Build Tests/Tests.UWP run: msbuild Tests/Tests.UWP -restore -p:Configuration=Release -p:AppxBundle=Always -p:PackageCertificateKeyFile=${{ github.workspace }}\Tests\Tests.UWP\Tests.UWP_TemporaryKey.pfx -p:PackageCertificatePassword=${{ secrets.Pfx_Password }} -p:UseDotNetNativeToolchain=false -p:AppxBundlePlatforms=x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} - name: Run the tests - run: ./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs '' + run: ./Tests/Tests.UWP/RunTests.ps1 -ExtraAppArgs shell: powershell - name: Publish Unit Test Results if: always() @@ -773,7 +748,7 @@ jobs: - name: Build Tests/Tests.Maui run: dotnet build Tests/Tests.Maui -c Release -f net8.0-maccatalyst -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} - name: Run the tests - run: 'Tests/Tests.Maui/bin/Release/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.xml --labels=All ' + run: Tests/Tests.Maui/bin/Release/net8.0-maccatalyst/maccatalyst-x64/Tests.Maui.app/Contents/MacOS/Tests.Maui --headless --result=${{ github.workspace }}/TestResults.xml --labels=All - name: Transform Results run: xsltproc --output TestResults.xml_transformed.xml Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt TestResults.xml - name: Publish Unit Test Results @@ -880,7 +855,7 @@ jobs: appPath: Tests/Tests.Maui/bin/Release/net8.0-ios/iossimulator-x64/Tests.Maui.app bundleId: io.realm.mauitests iphoneToSimulate: iPhone-15 - arguments: '--headless --result=${{ github.workspace }}/TestResults.xml --labels=All ' + arguments: --headless --result=${{ github.workspace }}/TestResults.xml --labels=All os: iOS - name: Transform Results run: xsltproc --output TestResults.xml_transformed.xml Tests/Realm.Tests/EmbeddedResources/nunit3-junit.xslt TestResults.xml @@ -932,7 +907,7 @@ jobs: appPath: Tests/Tests.XamarinTVOS/bin/iPhoneSimulator/Release/Tests.XamarinTVOS.app bundleId: io.realm.Tests-XamarinTVOS iphoneToSimulate: Apple-TV-1080p - arguments: '--headless --result=${{ github.workspace }}/TestResults.xml --labels=All ' + arguments: --headless --result=${{ github.workspace }}/TestResults.xml --labels=All os: tvOS - name: Publish Unit Test Results if: always() @@ -1227,9 +1202,6 @@ jobs: with: name: wrappers-linux-x86_64 path: wrappers/build - - name: Deploy Apps - working-directory: Tools/DeployApps - run: dotnet run deploy-apps --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=code-coverage-${{ github.run_id }}-${{ github.run_attempt }} - name: Setup Coverlet & Report Generator run: |- dotnet tool install coverlet.console --tool-path tools @@ -1245,7 +1217,7 @@ jobs: env: DOTNET_DbgEnableMiniDump: 1 DOTNET_EnableCrashReport: 1 - run: ./tools/coverlet ./Tests/Realm.Tests/bin/Release/net8.0/linux-x64 -t ${{ steps.dotnet-publish.outputs.executable-path }} -a '--result=TestResults.xml --labels=After --baasaas-api-key=${{ secrets.BAASAAS_API_KEY}} --baas-differentiator=code-coverage-${{ github.run_id }}-${{ github.run_attempt }}' -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*' --exclude '[Realm.PlatformHelpers]*' + run: ./tools/coverlet ./Tests/Realm.Tests/bin/Release/net8.0/linux-x64 -t ${{ steps.dotnet-publish.outputs.executable-path }} -a '--result=TestResults.xml --labels=After' -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*' --exclude '[Realm.PlatformHelpers]*' - name: Archive core dump if: ${{ failure() && runner.os != 'Windows' }} uses: actions/upload-artifact@v4 @@ -1274,33 +1246,6 @@ jobs: list-suites: failed path-replace-backslashes: true fail-on-error: true - cleanup-baas: - name: Cleanup BaaS - needs: - - test-code-coverage - if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') - runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - submodules: false - ref: ${{ github.event.pull_request.head.sha }} - - name: Register problem matchers - run: |- - echo "::add-matcher::.github/problem-matchers/csc.json" - echo "::add-matcher::.github/problem-matchers/msvc.json" - - uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59 - with: - dotnet-version: 8.0.x - - name: Terminate Baas - working-directory: Tools/DeployApps - run: dotnet run terminate-baas --baasaas-api-key=${{ secrets.BAASAAS_API_KEY }} --baas-differentiator=${{ matrix.differentiator }}-${{ github.run_id }}-${{ github.run_attempt }} - strategy: - matrix: - differentiator: - - code-coverage - fail-fast: false verify-namespaces: name: Verify Namespaces needs: diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 7ddf53b098..ede03abc3c 100755 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -38,14 +38,6 @@ jobs: aws-access-key-id: ${{ secrets.DOCS_S3_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.DOCS_S3_SECRET_KEY }} aws-region: us-east-2 - - name: Upload docs - run: |- - Expand-Archive -Path Realm/packages/Docs.zip/Docs.zip -DestinationPath Realm/packages - $versions = "${{ steps.get-version.outputs.package_version }}", "latest" - Foreach ($ver in $versions) - { - aws s3 sync --acl public-read "${{ github.workspace }}\Realm\packages\_site" s3://realm-sdks/docs/realm-sdks/dotnet/$ver/ - } - name: NuGet Publish Realm.${{ steps.get-version.outputs.package_version }} run: dotnet nuget push ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.package_version }}/Realm.${{ steps.get-version.outputs.package_version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - name: NuGet Publish Realm.PlatformHelpers.${{ steps.get-version.outputs.package_version }}