From f2b935e2c25748e855b885cc9080e36de4054f31 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 9 Mar 2025 22:26:53 -0700 Subject: [PATCH 1/5] [CI] Add support for GitHub Actions --- .github/workflows/pull_request.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..19a0a1c --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,15 @@ +name: Pull request + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + tests: + name: Test + uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main + soundness: + name: Soundness + uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main + with: + license_header_check_project_name: "Swift.org" From 9d8a84f617891a7bd24d7f23413b8f5306710b0a Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 9 Mar 2025 22:36:23 -0700 Subject: [PATCH 2/5] Only run swift build --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 19a0a1c..22a56e7 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -8,6 +8,9 @@ jobs: tests: name: Test uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main + with: + linux_build_command: "swift build" + windows_build_command: "swift build" soundness: name: Soundness uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main From bb36cbbfcc0f55c4151f4e1cba43eae9697cacc7 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 9 Mar 2025 23:48:24 -0700 Subject: [PATCH 3/5] Skip testing on Swift 5.8 --- .github/workflows/pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 22a56e7..6e6a281 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,6 +10,7 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main with: linux_build_command: "swift build" + linux_exclude_swift_versions: '[{"swift_version": "5.8"}]' windows_build_command: "swift build" soundness: name: Soundness From 970c353417654599aa08d94d9f2ebe057bd05591 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 9 Mar 2025 23:57:13 -0700 Subject: [PATCH 4/5] Update the Package.swift format --- Package.swift | 78 ++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/Package.swift b/Package.swift index ff4106f..283944c 100644 --- a/Package.swift +++ b/Package.swift @@ -2,42 +2,44 @@ import PackageDescription let package = Package( - name: "swift-toolchain-sqlite", - products: [ - .executable( - name: "sqlite", - targets: ["sqlite"]), - .library( - name: "SwiftToolchainCSQLite", - targets: ["SwiftToolchainCSQLite"]), - ], - targets: [ - .executableTarget( - name: "sqlite", - dependencies: ["SwiftToolchainCSQLite"], - cSettings: [ - .define("SQLITE_OMIT_LOAD_EXTENSION"), - .define("SQLITE_NOHAVE_SYSTEM", .when(platforms: [.macCatalyst, .iOS, .tvOS, .watchOS, .visionOS, .wasi])), - .define("HAVE_READLINE", .when(platforms: [.macOS, .macCatalyst])), - .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), - .define("_WASI_EMULATED_PROCESS_CLOCKS", .when(platforms: [.wasi])), - .define("_WASI_EMULATED_GETPID", .when(platforms: [.wasi])), - .define("chmod(a,b)=0", .when(platforms: [.wasi])), - ], - linkerSettings: [ - .linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])), - .linkedLibrary("wasi-emulated-process-clocks", .when(platforms: [.wasi])), - .linkedLibrary("wasi-emulated-getpid", .when(platforms: [.wasi])), - ] - ), - .target( - name: "SwiftToolchainCSQLite", - path: "Sources/CSQLite", - publicHeadersPath: "include", - linkerSettings: [ - // Needed for swift_addNewDSOImage - .linkedLibrary("swiftCore", .when(platforms: [.windows, .wasi])) - ] - ), - ] + name: "swift-toolchain-sqlite", + products: [ + .executable( + name: "sqlite", + targets: ["sqlite"]), + .library( + name: "SwiftToolchainCSQLite", + targets: ["SwiftToolchainCSQLite"]), + ], + targets: [ + .executableTarget( + name: "sqlite", + dependencies: ["SwiftToolchainCSQLite"], + cSettings: [ + .define("SQLITE_OMIT_LOAD_EXTENSION"), + .define( + "SQLITE_NOHAVE_SYSTEM", + .when(platforms: [.macCatalyst, .iOS, .tvOS, .watchOS, .visionOS, .wasi])), + .define("HAVE_READLINE", .when(platforms: [.macOS, .macCatalyst])), + .define("_WASI_EMULATED_SIGNAL", .when(platforms: [.wasi])), + .define("_WASI_EMULATED_PROCESS_CLOCKS", .when(platforms: [.wasi])), + .define("_WASI_EMULATED_GETPID", .when(platforms: [.wasi])), + .define("chmod(a,b)=0", .when(platforms: [.wasi])), + ], + linkerSettings: [ + .linkedLibrary("wasi-emulated-signal", .when(platforms: [.wasi])), + .linkedLibrary("wasi-emulated-process-clocks", .when(platforms: [.wasi])), + .linkedLibrary("wasi-emulated-getpid", .when(platforms: [.wasi])), + ] + ), + .target( + name: "SwiftToolchainCSQLite", + path: "Sources/CSQLite", + publicHeadersPath: "include", + linkerSettings: [ + // Needed for swift_addNewDSOImage + .linkedLibrary("swiftCore", .when(platforms: [.windows, .wasi])) + ] + ), + ] ) From 6d0d395c601c65e26d1633141e5c077eb94a19e1 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Sun, 9 Mar 2025 23:59:48 -0700 Subject: [PATCH 5/5] Disable Soundness / Unacceptable language check and License headers check --- .github/workflows/pull_request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 6e6a281..8be2d0b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -17,3 +17,5 @@ jobs: uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main with: license_header_check_project_name: "Swift.org" + license_header_check_enabled: false + unacceptable_language_check_enabled: false