From 9d34f51080eadc71990d34ec75cf7bd2c2cdee51 Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Wed, 2 Sep 2026 11:47:56 -0400 Subject: [PATCH 01/10] Workflow cleanup and release doc --- .github/workflows/build.yml | 14 ++------ .github/workflows/release.yml | 44 ++++++++++------------- RELEASING.md | 67 +++++++++++++++++++++++++++++++++++ gradle.properties | 2 +- 4 files changed, 90 insertions(+), 37 deletions(-) create mode 100644 RELEASING.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47049b6..bb30c68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,9 +16,9 @@ jobs: runs-on: ${{matrix.os}} steps: - name: Checkout the repo - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/setup-java@v5 + - uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: "temurin" java-version: "17" @@ -32,15 +32,7 @@ jobs: install: git mingw-w64-x86_64-toolchain libsqlite - name: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - - name: Cache konan - uses: actions/cache@v4 - with: - path: ~/.konan - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Update Environment Variables if: matrix.os == 'windows-latest' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 813972c..a303426 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,36 +1,23 @@ name: release -on: workflow_dispatch +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" jobs: - release: + publish: runs-on: macos-latest steps: - name: Checkout the repo - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: touchlab/read-property@0.1 - id: version-name - with: - file: ./gradle.properties - property: VERSION_NAME - - - name: Echo Version - run: echo "${{ steps.version-name.outputs.propVal }}" - - - uses: actions/setup-java@v5 + - uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 with: distribution: "temurin" java-version: "17" - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - name: Cache konan - uses: actions/cache@v4 - with: - path: ~/.konan - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- + - name: Setup Gradle + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - name: Publish Artifacts to Maven Central run: ./gradlew publish --no-daemon --stacktrace --no-build-cache @@ -39,11 +26,18 @@ jobs: ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + release: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Create Release - if: ${{ contains(steps.version-name.outputs.propVal, 'SNAPSHOT') == false }} - uses: touchlab/release-action@v1.10.0 + uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 with: - tag: ${{ steps.version-name.outputs.propVal }} + generate_release_notes: true env: GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m" diff --git a/RELEASING.md b/RELEASING.md new file mode 100644 index 0000000..b0cd23e --- /dev/null +++ b/RELEASING.md @@ -0,0 +1,67 @@ +# Releasing + +SQLiter publishes `co.touchlab:sqliter-driver` to Maven Central. Releases are cut by pushing a release +tag. + +## Conventions + +- Tags are the bare version, no `v` prefix — `1.4.0`, not `v1.4.0`. +- The tag and `VERSION_NAME` must be identical. +- `main` sits on a `-SNAPSHOT` between releases. + +## Choosing the version + +Standard semver against the published API surface: + +- **Patch** — bug fixes, no public declarations added or changed. +- **Minor** — public declarations added. +- **Major** — public declarations removed or changed incompatibly. + +## Releasing + +Steps 1–6 are local. Nothing is published until you push the tag in step 7. + +1. **Confirm the working tree is clean and `main` is current.** +2. **Set the release version** in `gradle.properties`: + + ``` + VERSION_NAME=X.Y.Z + ``` + +3. **Commit.** + + ```bash + git commit -am "Prepare version X.Y.Z" + ``` + +4. **Tag that commit.** + + ```bash + git tag -a X.Y.Z -m "Version X.Y.Z" + ``` + +5. **Set the next development version.** Bump the patch and re-add the suffix in + `gradle.properties`: + + ``` + VERSION_NAME=-SNAPSHOT + ``` + + So releasing `1.4.1` leaves `main` on `VERSION_NAME=1.4.2-SNAPSHOT`. + +6. **Commit.** + + ```bash + git commit -am "Prepare next development version" + ``` + +7. **Push the branch first, then the tag.** Pushing the tag triggers the release, so push it last: + + ```bash + git push origin main + git push origin X.Y.Z + ``` + + Pushing requires bypassing main branch protections, if you're not set up to do this, you probably shouldn't be + publishing anyway + diff --git a/gradle.properties b/gradle.properties index fbaaede..3683cc7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ kotlin.code.style=official GROUP=co.touchlab -VERSION_NAME=1.4.0 +VERSION_NAME=1.4.1-SNAPSHOT KOTLIN_VERSION=2.2.10 kotlin.native.ignoreDisabledTargets=true From da3e1a72d74e64cc77a9b66bfe2eea30f50a0f9a Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Wed, 2 Sep 2026 11:50:55 -0400 Subject: [PATCH 02/10] Re-enable Windows and Linux native tests on matching hosts --- .github/workflows/build.yml | 2 +- sqliter-driver/build.gradle.kts | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47049b6..1ceeee0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: with: msystem: MINGW64 update: true - install: git mingw-w64-x86_64-toolchain libsqlite + install: git mingw-w64-x86_64-toolchain mingw-w64-x86_64-sqlite3 - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 diff --git a/sqliter-driver/build.gradle.kts b/sqliter-driver/build.gradle.kts index 0f9ec9a..a892ff7 100644 --- a/sqliter-driver/build.gradle.kts +++ b/sqliter-driver/build.gradle.kts @@ -83,11 +83,14 @@ mavenPublishing { publishToMavenCentral(automaticRelease = true) } -listOf( - "linuxX64Test", - "linuxArm64Test", - "linkDebugTestLinuxX64", - "linkDebugTestLinuxArm64", - "mingwX64Test", - "linkDebugTestMingwX64", -).forEach { tasks.findByName(it)?.enabled = false } +val disabledTestLinks = mutableListOf("linkDebugTestLinuxArm64") + +if (!HostManager.hostIsLinux) { + disabledTestLinks += "linkDebugTestLinuxX64" +} + +if (!HostManager.hostIsMingw) { + disabledTestLinks += "linkDebugTestMingwX64" +} + +disabledTestLinks.forEach { tasks.findByName(it)?.enabled = false } From 2deb2d63277ced43183b22fc75fe760318313afa Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Wed, 2 Sep 2026 13:49:36 -0400 Subject: [PATCH 03/10] Point setup-msys2 at the runner's preinstalled MSYS2 so sqlite3 is findable --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ceeee0..cafeccb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: msystem: MINGW64 update: true install: git mingw-w64-x86_64-toolchain mingw-w64-x86_64-sqlite3 + release: false - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 From e7d3e90b496ba7c812b62ba7974a10f8d3cbc422 Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Wed, 2 Sep 2026 14:53:50 -0400 Subject: [PATCH 04/10] Don't install extra toolchain --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cafeccb..a769d6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: with: msystem: MINGW64 update: true - install: git mingw-w64-x86_64-toolchain mingw-w64-x86_64-sqlite3 + install: mingw-w64-x86_64-sqlite3 release: false - name: Setup Gradle From 16113fc15d048c546dc0693da833dd8325be0c46 Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Wed, 2 Sep 2026 15:56:14 -0400 Subject: [PATCH 05/10] Normalize forward slashes in the Windows File path handling The three databasePathRemoves* tests fail on mingwX64. They were added in f59c6b1 along with a mechanical port of the file:// handling to all three File.kt copies, but the mingw tests have never run, so the port was never checked against a Windows host. mingw's File sets separatorChar to a back slash, and both fixSlashes and join compared against it directly. Forward slashes were therefore not separators: "//tmp//" collapsed to nothing, and join saw no trailing separator and inserted one, so File("//tmp//", "testdb") produced "//tmp//\testdb". Windows accepts either slash direction, so treat both as separators and normalize to separatorChar. Paths built from USERPROFILE are unaffected as they already use back slashes; only inputs that previously produced mixed garbage change. fixSlashes also reused the original string whenever the length was unchanged. That held when the only edits were collapsing and truncating, but rewriting slashes in place keeps the length, so drop the shortcut and always rebuild. The tests asserted POSIX separators. Derive the expected separator from Platform.osFamily so they assert the same normalization on every host. --- .../co/touchlab/sqliter/internal/File.kt | 18 +++++++++++------- .../sqliter/DatabaseConfigurationTest.kt | 11 ++++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt b/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt index 59b9141..af4d3c1 100644 --- a/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt +++ b/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt @@ -71,7 +71,8 @@ internal actual class File(dirPath:String? = null, name:String) { */ constructor(dir: File, name: String) : this(dir.path, name) - // Removes duplicate adjacent back slashes and any trailing back slashes. + // Removes duplicate adjacent separators and any trailing separator. Windows accepts either + // slash direction, so both count as separators and are normalized to [separatorChar]. private fun fixSlashes(origPath: String): String { // Remove duplicate adjacent slashes. var lastWasSlash = false @@ -81,7 +82,7 @@ internal actual class File(dirPath:String? = null, name:String) { val initialIndex = if (origPath.startsWith("file://", true)) 7 else 0 for (i in initialIndex until length) { val ch = newPath[i] - if (ch == separatorChar) { + if (isSeparator(ch)) { if (!lastWasSlash) { newPath[newLength++] = separatorChar lastWasSlash = true @@ -97,21 +98,24 @@ internal actual class File(dirPath:String? = null, name:String) { newLength-- } - // Reuse the original string if possible. - return if (newLength != length) buildString(newLength) { + // Always rebuild. An unchanged length doesn't mean an unchanged string here, as forward + // slashes are rewritten in place without shortening the path. + return buildString(newLength) { append(newPath) setLength(newLength) - } else origPath + } } + private fun isSeparator(ch: Char): Boolean = ch == '/' || ch == '\\' + /** * Returns the combination of the prefix and suffix with a back slash added if necessary. */ private fun join(prefix: String, suffix: String): String { val prefixLength = prefix.length - var haveSlash = prefixLength > 0 && prefix[prefixLength - 1] == separatorChar + var haveSlash = prefixLength > 0 && isSeparator(prefix[prefixLength - 1]) if (!haveSlash) { - haveSlash = suffix.isNotEmpty() && suffix[0] == separatorChar + haveSlash = suffix.isNotEmpty() && isSeparator(suffix[0]) } return if (haveSlash) prefix + suffix else prefix + separatorChar + suffix } diff --git a/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt b/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt index c98594a..8e4af3a 100644 --- a/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt +++ b/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt @@ -16,10 +16,15 @@ package co.touchlab.sqliter +import kotlin.native.OsFamily +import kotlin.native.Platform import kotlin.test.* class DatabaseConfigurationTest : BaseDatabaseTest(){ + // Paths are normalized to the host's separator, which is a back slash on Windows. + private val sep = if (Platform.osFamily == OsFamily.WINDOWS) "\\" else "/" + @Test fun pathTest(){ val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, null) @@ -29,19 +34,19 @@ class DatabaseConfigurationTest : BaseDatabaseTest(){ @Test fun databasePathRemovesExtraSlashes() { val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "//tmp//") - assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + assertEquals("${sep}tmp$sep$TEST_DB_NAME", dbPathString) } @Test fun databasePathRemovesFileUrlPrefix() { val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "file:///tmp/") - assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + assertEquals("${sep}tmp$sep$TEST_DB_NAME", dbPathString) } @Test fun databasePathRemovesFileUrlPrefixInCaps() { val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "FILE:///tmp/") - assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + assertEquals("${sep}tmp$sep$TEST_DB_NAME", dbPathString) } @Test From 1c91a8649c76dd0be81dddbe94b2b7e015429ce7 Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Wed, 2 Sep 2026 16:10:00 -0400 Subject: [PATCH 06/10] Focus on windows for now --- .github/workflows/build.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a769d6a..6d97cd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ macOS-latest, windows-latest, ubuntu-latest ] + os: [ windows-latest ] runs-on: ${{matrix.os}} steps: - name: Checkout the repo @@ -35,14 +35,6 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - - name: Cache konan - uses: actions/cache@v4 - with: - path: ~/.konan - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Update Environment Variables if: matrix.os == 'windows-latest' shell: bash From 56d82989bb05a3ba868d4b3354b70792b3108052 Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Thu, 3 Sep 2026 10:56:19 -0400 Subject: [PATCH 07/10] Ignore broken tests. Revert logic changes --- .../co/touchlab/sqliter/internal/File.kt | 18 +++++++----------- .../sqliter/DatabaseConfigurationTest.kt | 16 ++++++++-------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt b/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt index af4d3c1..59b9141 100644 --- a/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt +++ b/sqliter-driver/src/mingwMain/kotlin/co/touchlab/sqliter/internal/File.kt @@ -71,8 +71,7 @@ internal actual class File(dirPath:String? = null, name:String) { */ constructor(dir: File, name: String) : this(dir.path, name) - // Removes duplicate adjacent separators and any trailing separator. Windows accepts either - // slash direction, so both count as separators and are normalized to [separatorChar]. + // Removes duplicate adjacent back slashes and any trailing back slashes. private fun fixSlashes(origPath: String): String { // Remove duplicate adjacent slashes. var lastWasSlash = false @@ -82,7 +81,7 @@ internal actual class File(dirPath:String? = null, name:String) { val initialIndex = if (origPath.startsWith("file://", true)) 7 else 0 for (i in initialIndex until length) { val ch = newPath[i] - if (isSeparator(ch)) { + if (ch == separatorChar) { if (!lastWasSlash) { newPath[newLength++] = separatorChar lastWasSlash = true @@ -98,24 +97,21 @@ internal actual class File(dirPath:String? = null, name:String) { newLength-- } - // Always rebuild. An unchanged length doesn't mean an unchanged string here, as forward - // slashes are rewritten in place without shortening the path. - return buildString(newLength) { + // Reuse the original string if possible. + return if (newLength != length) buildString(newLength) { append(newPath) setLength(newLength) - } + } else origPath } - private fun isSeparator(ch: Char): Boolean = ch == '/' || ch == '\\' - /** * Returns the combination of the prefix and suffix with a back slash added if necessary. */ private fun join(prefix: String, suffix: String): String { val prefixLength = prefix.length - var haveSlash = prefixLength > 0 && isSeparator(prefix[prefixLength - 1]) + var haveSlash = prefixLength > 0 && prefix[prefixLength - 1] == separatorChar if (!haveSlash) { - haveSlash = suffix.isNotEmpty() && isSeparator(suffix[0]) + haveSlash = suffix.isNotEmpty() && suffix[0] == separatorChar } return if (haveSlash) prefix + suffix else prefix + separatorChar + suffix } diff --git a/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt b/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt index 8e4af3a..dcb2833 100644 --- a/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt +++ b/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt @@ -16,37 +16,37 @@ package co.touchlab.sqliter -import kotlin.native.OsFamily -import kotlin.native.Platform import kotlin.test.* class DatabaseConfigurationTest : BaseDatabaseTest(){ - // Paths are normalized to the host's separator, which is a back slash on Windows. - private val sep = if (Platform.osFamily == OsFamily.WINDOWS) "\\" else "/" - @Test fun pathTest(){ val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, null) assertTrue(dbPathString.endsWith(TEST_DB_NAME)) } + // The three tests below fail on Windows. See https://github.com/touchlab/SQLiter/issues/140 + + @Ignore // Wrong on Windows: produces "//tmp//\testdb" there, not "/tmp/testdb". @Test fun databasePathRemovesExtraSlashes() { val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "//tmp//") - assertEquals("${sep}tmp$sep$TEST_DB_NAME", dbPathString) + assertEquals("/tmp/$TEST_DB_NAME", dbPathString) } + @Ignore // Wrong on Windows: produces "/tmp/\testdb" there, not "/tmp/testdb". @Test fun databasePathRemovesFileUrlPrefix() { val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "file:///tmp/") - assertEquals("${sep}tmp$sep$TEST_DB_NAME", dbPathString) + assertEquals("/tmp/$TEST_DB_NAME", dbPathString) } + @Ignore // Wrong on Windows: produces "/tmp/\testdb" there, not "/tmp/testdb". @Test fun databasePathRemovesFileUrlPrefixInCaps() { val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "FILE:///tmp/") - assertEquals("${sep}tmp$sep$TEST_DB_NAME", dbPathString) + assertEquals("/tmp/$TEST_DB_NAME", dbPathString) } @Test From c0deb98959fdfe698022d177a6c12c0ff0bc5ff1 Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Thu, 3 Sep 2026 11:56:27 -0400 Subject: [PATCH 08/10] Suppress Linux linker error --- .github/workflows/build.yml | 2 +- sqliter-driver/build.gradle.kts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d97cd8..2000527 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ windows-latest ] + os: [ ubuntu-latest ] runs-on: ${{matrix.os}} steps: - name: Checkout the repo diff --git a/sqliter-driver/build.gradle.kts b/sqliter-driver/build.gradle.kts index a892ff7..02f9ea1 100644 --- a/sqliter-driver/build.gradle.kts +++ b/sqliter-driver/build.gradle.kts @@ -50,9 +50,11 @@ kotlin { target.compilerOptions { freeCompilerArgs.addAll( when { + // lld's default --no-allow-shlib-undefined fails the link with K/N's glibc. The symbols are + // only referenced by libsqlite3 itself and the system loader resolves them at runtime. HostManager.hostIsLinux -> listOf( "-linker-options", - "-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib" + "-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib --allow-shlib-undefined" ) HostManager.hostIsMingw -> listOf("-linker-options", "-lsqlite3 -Lc:\\msys64\\mingw64\\lib") From f22b3f50620433058e19a792e2fd75fe9c11d01c Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Thu, 3 Sep 2026 14:58:56 -0400 Subject: [PATCH 09/10] Re-enable platforms --- .github/workflows/build.yml | 2 +- .../sqliter/DatabaseConfigurationTest.kt | 32 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2000527..246d402 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] + os: [ macOS-latest, windows-latest, ubuntu-latest ] runs-on: ${{matrix.os}} steps: - name: Checkout the repo diff --git a/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt b/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt index dcb2833..9bb59e2 100644 --- a/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt +++ b/sqliter-driver/src/nativeTest/kotlin/co/touchlab/sqliter/DatabaseConfigurationTest.kt @@ -26,27 +26,37 @@ class DatabaseConfigurationTest : BaseDatabaseTest(){ assertTrue(dbPathString.endsWith(TEST_DB_NAME)) } - // The three tests below fail on Windows. See https://github.com/touchlab/SQLiter/issues/140 - - @Ignore // Wrong on Windows: produces "//tmp//\testdb" there, not "/tmp/testdb". @Test fun databasePathRemovesExtraSlashes() { - val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "//tmp//") - assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + if (Platform.osFamily != OsFamily.WINDOWS) { + val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "//tmp//") + assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + } else { + // On Windows: produces "//tmp//\testdb" there, not "/tmp/testdb". + println("Skipped for windows see issue #140") + } } - @Ignore // Wrong on Windows: produces "/tmp/\testdb" there, not "/tmp/testdb". @Test fun databasePathRemovesFileUrlPrefix() { - val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "file:///tmp/") - assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + if (Platform.osFamily != OsFamily.WINDOWS) { + val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "file:///tmp/") + assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + } else { + // On Windows: produces "/tmp/\testdb" there, not "/tmp/testdb". + println("Skipped for windows see issue #140") + } } - @Ignore // Wrong on Windows: produces "/tmp/\testdb" there, not "/tmp/testdb". @Test fun databasePathRemovesFileUrlPrefixInCaps() { - val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "FILE:///tmp/") - assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + if (Platform.osFamily != OsFamily.WINDOWS) { + val dbPathString = DatabaseFileContext.databasePath(TEST_DB_NAME, "FILE:///tmp/") + assertEquals("/tmp/$TEST_DB_NAME", dbPathString) + } else { + // On Windows: produces "/tmp/\testdb" there, not "/tmp/testdb". + println("Skipped for windows see issue #140") + } } @Test From 4e40ffe7b54f1e80618662404e14be611861e0f1 Mon Sep 17 00:00:00 2001 From: Sam Hill Date: Thu, 3 Sep 2026 15:40:49 -0400 Subject: [PATCH 10/10] Organize workflow steps --- .github/workflows/build.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb30c68..3f5931a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,29 +23,24 @@ jobs: distribution: "temurin" java-version: "17" + - name: Setup Gradle + uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 + - name: Install msys2 if: matrix.os == 'windows-latest' - uses: msys2/setup-msys2@v2 + uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0 with: msystem: MINGW64 update: true install: git mingw-w64-x86_64-toolchain libsqlite - - name: Setup Gradle - uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 - - name: Update Environment Variables if: matrix.os == 'windows-latest' shell: bash run: | echo "c:\msys64\mingw64\bin" >> $GITHUB_PATH - - name: Build - if: matrix.os != 'macOS-latest' + - name: Build and test run: ./gradlew build --no-daemon --stacktrace - - - name: Build and Test - if: matrix.os == 'macOS-latest' - run: ./gradlew build allTests --no-daemon --stacktrace env: GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"