Skip to content

Commit

Permalink
Try and use a newer runner to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Aug 19, 2024
1 parent e6c19b2 commit 99bcd8a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/pkl-workflows/codeql.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs {
}
}
...Steps.setupAndroid()
...Steps.setupWorkloads("tvos ios maccatalyst android", "8.0.x")
Steps.setupDotnet("8.0.x")
...Steps.msbuild(new Steps.MSBuildConfig {
projects = Common.packages.map((pkg) -> "Realm/\(pkg)").toListing()
properties {
Expand Down
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
14 changes: 7 additions & 7 deletions .github/pkl-workflows/helpers/Test.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function weaver(): gha.StepJobBase = testJob(
},
(config) -> new Listing<gha.Step> {
...Steps.checkout(false)
...Steps.setupWorkloads(null, "6.0.x")
Steps.setupDotnet("6.0.x")
...Steps.dotnetPublish("Tests/Weaver/Realm.Fody.Tests", "net6.0", "${{ matrix.os.runtime }}", new Mapping{}).toList()
...dotnetRunTests(false)
...reportTestResults(config)
Expand Down Expand Up @@ -129,7 +129,7 @@ function sourceGeneration(): gha.StepJobBase = testJob(
null,
(config) -> new Listing<gha.Step> {
...Steps.checkout(false)
...Steps.setupWorkloads(null, "6.0.x")
Steps.setupDotnet("6.0.x")
...Steps.dotnetPublish("Tests/SourceGenerators/Realm.SourceGenerator.Tests", "net6.0", "win-x64", new Mapping{}).toList()
...dotnetRunTests(false)
...reportTestResults(config)
Expand Down Expand Up @@ -212,11 +212,11 @@ function iOS_Maui(): gha.StepJobBase = testJob(
title = "Maui.iOS"
transformResults = true
},
"macos-13",
"macos-14",
null,
(config) -> new Listing<gha.Step> {
...prepareTests(config)
...Steps.setupWorkloads("maui", null)
...Steps.setupMaui()
Steps.setupXcode("latest-stable")
Steps.dotnetBuild("Tests/Tests.Maui", "net8.0-ios", null, getTestProps(false))
Steps.runSimulator(new Steps.SimulatorConfig{
Expand Down Expand Up @@ -256,11 +256,11 @@ function macOS_Maui(): gha.StepJobBase = testJob(
title = "Maui.MacCatalyst"
transformResults = true
},
"macos-13",
"macos-14",
null,
(config) -> new Listing<gha.Step> {
...prepareTests(config)
...Steps.setupWorkloads("maui", null)
...Steps.setupMaui()
Steps.setupXcode("latest-stable")
Steps.dotnetBuild("Tests/Tests.Maui", "net8.0-maccatalyst", null, getTestProps(false))
new {
Expand Down Expand Up @@ -347,7 +347,7 @@ function android_Maui(): gha.StepJobBase = testJob(
(config) -> new Listing<gha.Step> {
Steps.setupJDK()
...prepareTests(config)
...Steps.setupWorkloads("maui", null)
...Steps.setupMaui()
...Steps.dotnetPublish("Tests/Tests.Maui", "net8.0-android", /* runtime */ null, getTestProps(false))
...Steps.runDeviceFarm(new Steps.DeviceFarmConfig {
apkPath = "${{ github.workspace }}/Tests/Tests.Maui/bin/Release/net8.0-android/publish/io.realm.mauitests-Signed.apk"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install tvos ios maccatalyst android
- name: Add msbuild to PATH
if: ${{ runner.os == 'Windows' }}
uses: microsoft/setup-msbuild@70b70342ae97ca98d5eaad06cafd26d30f9592a9
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,9 @@ jobs:
run: |-
echo "::add-matcher::.github/problem-matchers/csc.json"
echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Setup JDK
uses: actions/setup-java@2e74cbce18569d23ca8b812590dbb83f13ac7c5a
with:
distribution: microsoft
java-version: 17
- name: Setup Android
uses: android-actions/setup-android@e1f5280adf78cf863c0fa43ffabc64a9cd08153f
- name: Install SDK platform 21
run: sdkmanager --install "platforms;android-21"
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install tvos ios maccatalyst android
- name: Set version suffix
id: set-version-suffix
run: |-
Expand Down Expand Up @@ -675,7 +664,7 @@ jobs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
timeout-minutes: 60
runs-on: macos-13
runs-on: macos-14
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -694,7 +683,7 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
- name: Setup Maui workload
run: dotnet workload install maui
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
Expand Down Expand Up @@ -767,7 +756,7 @@ jobs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
timeout-minutes: 60
runs-on: macos-13
runs-on: macos-14
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -786,7 +775,7 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
- name: Setup Maui workload
run: dotnet workload install maui
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
Expand Down Expand Up @@ -945,7 +934,7 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
- name: Setup Maui workload
run: dotnet workload install maui
- name: Publish Tests/Tests.Maui
run: dotnet publish Tests/Tests.Maui -c Release -f net8.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} --no-self-contained
Expand Down Expand Up @@ -1037,8 +1026,6 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Setup workloads
run: dotnet workload install android ${{ (runner.os != 'Linux' && 'tvos ios maccatalyst') || '' }}
- name: Publish Tests/SourceGenerators/Realm.SourceGenerator.Tests
run: dotnet publish Tests/SourceGenerators/Realm.SourceGenerator.Tests -c Release -f net6.0 -r win-x64 --no-self-contained
- name: Output executable path
Expand Down Expand Up @@ -1075,8 +1062,6 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Setup workloads
run: dotnet workload install android ${{ (runner.os != 'Linux' && 'tvos ios maccatalyst') || '' }}
- name: Publish Tests/Weaver/Realm.Fody.Tests
run: dotnet publish Tests/Weaver/Realm.Fody.Tests -c Release -f net6.0 -r ${{ matrix.os.runtime }} --no-self-contained
- name: Output executable path
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,9 @@ jobs:
run: |-
echo "::add-matcher::.github/problem-matchers/csc.json"
echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Setup JDK
uses: actions/setup-java@2e74cbce18569d23ca8b812590dbb83f13ac7c5a
with:
distribution: microsoft
java-version: 17
- name: Setup Android
uses: android-actions/setup-android@e1f5280adf78cf863c0fa43ffabc64a9cd08153f
- name: Install SDK platform 21
run: sdkmanager --install "platforms;android-21"
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
run: dotnet workload install tvos ios maccatalyst android
- name: Set version suffix
id: set-version-suffix
run: |-
Expand Down Expand Up @@ -680,7 +669,7 @@ jobs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
timeout-minutes: 60
runs-on: macos-13
runs-on: macos-14
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -699,7 +688,7 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
- name: Setup Maui workload
run: dotnet workload install maui
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
Expand Down Expand Up @@ -772,7 +761,7 @@ jobs:
- build-packages
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
timeout-minutes: 60
runs-on: macos-13
runs-on: macos-14
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -791,7 +780,7 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
- name: Setup Maui workload
run: dotnet workload install maui
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
Expand Down Expand Up @@ -950,7 +939,7 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 8.0.x
- name: Setup workloads
- name: Setup Maui workload
run: dotnet workload install maui
- name: Publish Tests/Tests.Maui
run: dotnet publish Tests/Tests.Maui -c Release -f net8.0-android -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} --no-self-contained
Expand Down Expand Up @@ -1042,8 +1031,6 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Setup workloads
run: dotnet workload install android ${{ (runner.os != 'Linux' && 'tvos ios maccatalyst') || '' }}
- name: Publish Tests/SourceGenerators/Realm.SourceGenerator.Tests
run: dotnet publish Tests/SourceGenerators/Realm.SourceGenerator.Tests -c Release -f net6.0 -r win-x64 --no-self-contained
- name: Output executable path
Expand Down Expand Up @@ -1080,8 +1067,6 @@ jobs:
- uses: actions/setup-dotnet@5d1464d5da459f3d7085106d52e499f4dc5d0f59
with:
dotnet-version: 6.0.x
- name: Setup workloads
run: dotnet workload install android ${{ (runner.os != 'Linux' && 'tvos ios maccatalyst') || '' }}
- name: Publish Tests/Weaver/Realm.Fody.Tests
run: dotnet publish Tests/Weaver/Realm.Fody.Tests -c Release -f net6.0 -r ${{ matrix.os.runtime }} --no-self-contained
- name: Output executable path
Expand Down

0 comments on commit 99bcd8a

Please sign in to comment.