Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Experiment] Create a local-only realm package #3660

Merged
merged 18 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/pkl-workflows/GithubAction/GithubAction.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,11 @@ class Permissions {
}
typealias Permission = "read"|"write"|"none"

class Environment {
name: String
url: String?
}

// Concurrency
class Concurrency {
group: String
Expand All @@ -569,7 +574,7 @@ abstract class JobBase {
outputs: Mapping<String, String>?
`timeout-minutes`: Int?
permissions: (*Permissions|"read-all"|"write-all")?
environment: String?
environment: (*Environment|String)?
}

abstract class StepJobBase extends JobBase {
Expand Down
77 changes: 0 additions & 77 deletions .github/pkl-workflows/codeql.pkl

This file was deleted.

2 changes: 2 additions & 0 deletions .github/pkl-workflows/helpers/Actions.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ const createPR = "peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2
const publishGithubRelease = "ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5" // 1.14.0
const releaseToSlack = "realm/ci-actions/release-to-slack@6418e15ed9bbdb19b7d456a347e5623779f95cdf"
const setupCmake = "jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be" // 2.0.2
const uploadPagesArtifact = "actions/upload-pages-artifact@v3"
const deployPages = "actions/deploy-pages@v4"
47 changes: 0 additions & 47 deletions .github/pkl-workflows/helpers/BaaS.pkl

This file was deleted.

39 changes: 17 additions & 22 deletions .github/pkl-workflows/helpers/Common.pkl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,7 +21,7 @@ const job_Unity: String = "build-unity"

local const job_Wrappers: String = "build-wrappers"

const mainBranch: String = "main"
const mainBranch: String = "community"

typealias NetFramework = "net6.0" | "net8.0" | String(startsWith("${{ matrix")) | String(startsWith("net8"))
typealias NetRuntime = "win-x64" | "linux-x64" | "osx-x64" | "osx-arm64" | String(startsWith("${{ matrix"))
Expand All @@ -37,54 +36,50 @@ const wrapperBinaryNames: List<String> =
+ applePlatformTargets((platform, target) -> "\(platform)-\(target)")

const defaultEnv: Mapping<String, String | Boolean> = new {
["REALM_DISABLE_ANALYTICS"] = true
["DOTNET_NOLOGO"] = true
}

const function applePlatformTargets(_transform: (String, String) -> String): List<String> = applePlatforms.map((platform) -> appleTargets.map((target) -> _transform.apply(platform, target))).flatten()

const ifNotCanceledCondition = "always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')"

const nugetPackages: List<String> = List("Realm", "Realm.PlatformHelpers")
const nugetPackages: List<String> = List("Realm")
const packages: List<String> = nugetPackages + List("Realm.UnityUtils", "Realm.UnityWeaver")

const testTimeout: Int = 60

const function defaultBuildJobs(baasDifferentiators: Listing<SyncDifferentiator>, netCoreVersions: Listing<NetFramework>): Mapping<String, gha.JobBase> = new {
const function defaultBuildJobs(netCoreVersions: Listing<NetFramework>): Mapping<String, gha.JobBase> = 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
}
}
[job_Unity] = Package.unity()
...TestJobs.unity(new TestJobs.UnityTestConfig {
os = "linux"
})
...TestJobs.unity(new TestJobs.UnityTestConfig {
os = "windows"
})
["test-net-framework"] = TestJobs.netFramework(baasDifferentiators)
["test-uwp"] = TestJobs.uwp(baasDifferentiators)
// TODO: https://github.com/realm/realm-dotnet/issues/3667 the Unity licensing server needs to be fixed before we can reenable these
// ...TestJobs.unity(new TestJobs.UnityTestConfig {
// os = "linux"
// })
// ...TestJobs.unity(new TestJobs.UnityTestConfig {
// os = "windows"
// })
["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()
}
3 changes: 1 addition & 2 deletions .github/pkl-workflows/helpers/Package.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ function nuget(shouldBuildDocsCondition: String): gha.Job = new {
`timeout-minutes` = 30
steps {
...Steps.checkout(false)
...Steps.setupAndroid()
...Steps.setupWorkloads("tvos ios maccatalyst android", "8.0.x")
Steps.setupDotnet("8.0.x")
setVersionSuffix
...Steps.fetchWrappers(null)
...Steps.msbuild(new Steps.MSBuildConfig {
Expand Down
8 changes: 4 additions & 4 deletions .github/pkl-workflows/helpers/Steps.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ const function fetchWrappers(wrappers: List<String>(every((wrapper) -> Common.wr
}
})

const function setupWorkloads(workloads: String?, dotnetVersion: String?): Listing<gha.Step> = new {
setupDotnet(dotnetVersion)
const function setupMaui(): Listing<gha.Step> = new {
setupDotnet(null)
new {
name = "Setup workloads"
run = "dotnet workload install \(workloads ?? "android ${{ (runner.os != 'Linux' && 'tvos ios maccatalyst') || '' }}")"
name = "Setup Maui workload"
run = "dotnet workload install maui"
}
}

Expand Down
Loading
Loading