Skip to content

Commit

Permalink
chore(ci): use linux images for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aallam committed Jul 20, 2024
1 parent e282c6c commit 2fee3b2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

test-jvm:
name: Test JVM
runs-on: macos-11
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
Expand Down
39 changes: 21 additions & 18 deletions build-support/src/main/kotlin/Platforms.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.getValue
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.konan.target.HostManager

fun KotlinMultiplatformExtension.native() {
sourceSets.apply {
Expand All @@ -17,24 +18,26 @@ fun KotlinMultiplatformExtension.native() {
}

// Darwin targets
val darwinMain by creating { dependsOn(nativeMain) }
val darwinTest by creating { dependsOn(nativeTest) }
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
macosX64(),
macosArm64(),
tvosX64(),
tvosArm64(),
tvosSimulatorArm64(),
watchosArm32(),
watchosArm64(),
watchosX64(),
watchosSimulatorArm64(),
).forEach { target ->
getByName("${target.name}Main").dependsOn(darwinMain)
getByName("${target.name}Test").dependsOn(darwinTest)
if (HostManager.hostIsMac) {
val darwinMain by creating { dependsOn(nativeMain) }
val darwinTest by creating { dependsOn(nativeTest) }
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
macosX64(),
macosArm64(),
tvosX64(),
tvosArm64(),
tvosSimulatorArm64(),
watchosArm32(),
watchosArm64(),
watchosX64(),
watchosSimulatorArm64(),
).forEach { target ->
getByName("${target.name}Main").dependsOn(darwinMain)
getByName("${target.name}Test").dependsOn(darwinTest)
}
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions openai-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.konan.target.HostManager

plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
Expand Down Expand Up @@ -72,9 +74,11 @@ kotlin {
implementation(libs.ktor.client.curl)
}
}
val darwinTest by getting {
dependencies {
implementation(libs.ktor.client.darwin)
if (HostManager.hostIsMac) {
val darwinTest by getting {
dependencies {
implementation(libs.ktor.client.darwin)
}
}
}
}
Expand Down

0 comments on commit 2fee3b2

Please sign in to comment.