Skip to content

Commit 4a118a3

Browse files
committed
Test macOS in CI
1 parent 354448e commit 4a118a3

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
include:
1818
- os: macos-latest
19-
targets: iosSimulatorArm64Test jvmTest lintKotlin
19+
targets: iosSimulatorArm64Test macosArm64Test jvmTest lintKotlin
2020
- os: ubuntu-latest
2121
targets: testDebugUnitTest testReleaseUnitTest jvmTest
2222
- os: windows-latest

core/build.gradle.kts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
66
import org.jetbrains.kotlin.gradle.plugin.mpp.TestExecutable
77
import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
88
import org.jetbrains.kotlin.konan.target.Family
9-
import org.jetbrains.kotlin.konan.target.KonanTarget
109

1110

1211
plugins {
@@ -82,15 +81,22 @@ val downloadPowersyncFramework by tasks.registering(Download::class) {
8281
onlyIfModified(true)
8382
}
8483

85-
val unzipPowersyncFramework by tasks.registering(Copy::class) {
84+
val unzipPowersyncFramework by tasks.registering(Exec::class) {
8685
dependsOn(downloadPowersyncFramework)
8786

88-
from(
89-
zipTree(downloadPowersyncFramework.get().dest).matching {
90-
include("powersync-sqlite-core.xcframework/**")
91-
},
92-
)
93-
into(binariesFolder.map { it.dir("framework") })
87+
val zipfile = downloadPowersyncFramework.get().dest
88+
inputs.file(zipfile)
89+
val destination = File(zipfile.parentFile, "extracted")
90+
doFirst {
91+
destination.deleteRecursively()
92+
destination.mkdir()
93+
}
94+
95+
// We're using unzip here because the Gradle copy task doesn't support symlinks.
96+
executable = "unzip"
97+
args(zipfile.absolutePath)
98+
workingDir(destination)
99+
outputs.dir(destination)
94100
}
95101

96102
val sqliteJDBCFolder =
@@ -164,7 +170,7 @@ kotlin {
164170
linkerOpts("-framework", "powersync-sqlite-core")
165171
val frameworkRoot =
166172
binariesFolder
167-
.map { it.dir("framework/powersync-sqlite-core.xcframework/ios-arm64_x86_64-simulator") }
173+
.map { it.dir("framework/extracted/powersync-sqlite-core.xcframework/ios-arm64_x86_64-simulator") }
168174
.get()
169175
.asFile.path
170176

@@ -177,9 +183,9 @@ kotlin {
177183
binaries.withType<TestExecutable>().configureEach {
178184
linkTaskProvider.configure { dependsOn(unzipPowersyncFramework) }
179185
linkerOpts("-framework", "powersync-sqlite-core")
180-
val frameworkRoot =
186+
var frameworkRoot =
181187
binariesFolder
182-
.map { it.dir("framework/powersync-sqlite-core.xcframework/macos-arm64_x86_64") }
188+
.map { it.dir("framework/extracted/powersync-sqlite-core.xcframework/macos-arm64_x86_64") }
183189
.get()
184190
.asFile.path
185191

0 commit comments

Comments
 (0)