Skip to content

Commit b98ae6e

Browse files
committed
Bump Swift minimum to 6.0, update CI, convert tests to SwiftTesting
1 parent d2fd317 commit b98ae6e

File tree

9 files changed

+263
-244
lines changed

9 files changed

+263
-244
lines changed

.github/workflows/api-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
push:
44
branches:
55
- main
6+
permissions:
7+
contents: read
8+
id-token: write
69

710
jobs:
811
build-and-deploy:

.github/workflows/test.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ concurrency:
55
on:
66
pull_request: { types: [opened, reopened, synchronize, ready_for_review] }
77
push: { branches: [ main ] }
8-
8+
permissions:
9+
contents: read
910
env:
1011
LOG_LEVEL: info
11-
SWIFT_DETERMINISTIC_HASHING: 1
12-
POSTGRES_HOSTNAME: 'psql-a'
13-
POSTGRES_HOSTNAME_A: 'psql-a'
14-
POSTGRES_HOSTNAME_B: 'psql-b'
15-
POSTGRES_DB: 'test_database'
16-
POSTGRES_DB_A: 'test_database'
17-
POSTGRES_DB_B: 'test_database'
18-
POSTGRES_USER: 'test_username'
19-
POSTGRES_USER_A: 'test_username'
20-
POSTGRES_USER_B: 'test_username'
21-
POSTGRES_PASSWORD: 'test_password'
22-
POSTGRES_PASSWORD_A: 'test_password'
23-
POSTGRES_PASSWORD_B: 'test_password'
12+
POSTGRES_HOSTNAME_A: &postgres_host_a 'psql-a'
13+
POSTGRES_HOSTNAME_B: &postgres_host_b 'psql-b'
14+
POSTGRES_HOSTNAME: *postgres_host_a
15+
POSTGRES_DB_A: &postgres_db_a 'test_database_a'
16+
POSTGRES_DB_B: &postgres_db_b 'test_database_b'
17+
POSTGRES_DB: *postgres_db_a
18+
POSTGRES_USER_A: &postgres_user_a 'test_username'
19+
POSTGRES_USER_B: &postgres_user_b 'test_username'
20+
POSTGRES_USER: *postgres_user_a
21+
POSTGRES_PASSWORD_A: &postgres_pass_a 'test_password'
22+
POSTGRES_PASSWORD_B: &postgres_pass_b 'test_password'
23+
POSTGRES_PASSWORD: *postgres_pass_a
2424

2525
jobs:
2626
api-breakage:
@@ -42,29 +42,29 @@ jobs:
4242
fail-fast: false
4343
matrix:
4444
postgres-image:
45-
- postgres:17
46-
- postgres:15
47-
- postgres:13
45+
- postgres:18
46+
- postgres:16
47+
- postgres:14
4848
swift-image:
49-
- swift:5.10-jammy
5049
- swift:6.0-noble
5150
- swift:6.1-noble
51+
- swift:6.2-noble
5252
include:
53-
- postgres-image: postgres:17
53+
- postgres-image: postgres:18
5454
postgres-auth: scram-sha-256
55-
- postgres-image: postgres:15
55+
- postgres-image: postgres:16
5656
postgres-auth: md5
57-
- postgres-image: postgres:13
57+
- postgres-image: postgres:14
5858
postgres-auth: trust
5959
runs-on: ubuntu-latest
6060
container: ${{ matrix.swift-image }}
6161
services:
62-
psql-a:
62+
*postgres_host_a:
6363
image: ${{ matrix.postgres-image }}
6464
env:
65-
POSTGRES_USER: test_username
66-
POSTGRES_DB: test_database
67-
POSTGRES_PASSWORD: test_password
65+
POSTGRES_USER: *postgres_user_a
66+
POSTGRES_DB: *postgres_db_a
67+
POSTGRES_PASSWORD: *postgres_pass_a
6868
POSTGRES_HOST_AUTH_METHOD: ${{ matrix.postgres-auth }}
6969
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.postgres-auth }}
7070
steps:
@@ -73,7 +73,7 @@ jobs:
7373
- name: Check out package
7474
uses: actions/checkout@v5
7575
- name: Run local tests
76-
run: swift test --enable-code-coverage
76+
run: swift test --enable-code-coverage --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable
7777
- name: Upload coverage data
7878
uses: vapor/[email protected]
7979
with:
@@ -82,22 +82,22 @@ jobs:
8282
linux-integration:
8383
if: ${{ !(github.event.pull_request.draft || false) }}
8484
runs-on: ubuntu-latest
85-
container: swift:6.1-noble
85+
container: swift:6.2-noble
8686
services:
87-
psql-a:
88-
image: postgres:17
87+
*postgres_host_a:
88+
image: postgres:18
8989
env:
90-
POSTGRES_USER: test_username
91-
POSTGRES_DB: test_database
92-
POSTGRES_PASSWORD: test_password
90+
POSTGRES_USER: *postgres_user_a
91+
POSTGRES_DB: *postgres_db_a
92+
POSTGRES_PASSWORD: *postgres_pass_a
9393
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
9494
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
95-
psql-b:
96-
image: postgres:15
95+
*postgres_host_b:
96+
image: postgres:16
9797
env:
98-
POSTGRES_USER: test_username
99-
POSTGRES_DB: test_database
100-
POSTGRES_PASSWORD: test_password
98+
POSTGRES_USER: *postgres_user_b
99+
POSTGRES_DB: *postrges_db_b
100+
POSTGRES_PASSWORD: *postgres_pass_b
101101
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
102102
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
103103
steps:
@@ -118,10 +118,10 @@ jobs:
118118
fail-fast: false
119119
matrix:
120120
include:
121-
- macos-version: macos-14
122-
xcode-version: latest-stable
123121
- macos-version: macos-15
124122
xcode-version: latest-stable
123+
- macos-version: macos-26
124+
xcode-version: latest-stable
125125
runs-on: ${{ matrix.macos-version }}
126126
env:
127127
POSTGRES_HOSTNAME: 127.0.0.1
@@ -135,27 +135,27 @@ jobs:
135135
run: |
136136
brew upgrade || true
137137
export PATH="$(brew --prefix)/opt/postgresql@13/bin:$PATH" PGDATA=/tmp/vapor-postgres-test
138-
brew install "postgresql@17" && brew link --force "postgresql@17"
138+
brew install "postgresql@18" && brew link --force "postgresql@18"
139139
initdb --locale=C --auth-host "scram-sha-256" -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}")
140140
pg_ctl start --wait
141141
timeout-minutes: 15
142142
- name: Checkout code
143143
uses: actions/checkout@v5
144144
- name: Run local tests
145-
run: swift test --enable-code-coverage
145+
run: swift test --enable-code-coverage --explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable
146146
- name: Upload coverage data
147147
uses: vapor/[email protected]
148148
with:
149149
codecov_token: ${{ secrets.CODECOV_TOKEN || '' }}
150150

151151
musl:
152152
runs-on: ubuntu-latest
153-
container: swift:6.1-noble
153+
container: swift:6.2-noble
154154
timeout-minutes: 30
155155
steps:
156156
- name: Check out code
157157
uses: actions/checkout@v5
158158
- name: Install SDK
159-
run: swift sdk install https://download.swift.org/swift-6.1.2-release/static-sdk/swift-6.1.2-RELEASE/swift-6.1.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum df0b40b9b582598e7e3d70c82ab503fd6fbfdff71fd17e7f1ab37115a0665b3b
159+
run: swift sdk install https://download.swift.org/swift-6.2-release/static-sdk/swift-6.2-RELEASE/swift-6.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum d2225840e592389ca517bbf71652f7003dbf45ac35d1e57d98b9250368769378
160160
- name: Build
161161
run: swift build --swift-sdk x86_64-swift-linux-musl

Package.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.10
1+
// swift-tools-version:6.0
22
import PackageDescription
33

44
let package = Package(
@@ -14,7 +14,7 @@ let package = Package(
1414
],
1515
dependencies: [
1616
.package(url: "https://github.com/vapor/postgres-nio.git", from: "1.27.0"),
17-
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.33.1"),
17+
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.33.2"),
1818
.package(url: "https://github.com/vapor/async-kit.git", from: "1.21.0"),
1919
],
2020
targets: [
@@ -40,9 +40,9 @@ let package = Package(
4040

4141
var swiftSettings: [SwiftSetting] { [
4242
.enableUpcomingFeature("ExistentialAny"),
43+
.enableUpcomingFeature("InternalImportsByDefault"),
4344
.enableUpcomingFeature("MemberImportVisibility"),
44-
.enableUpcomingFeature("ConciseMagicFile"),
45-
.enableUpcomingFeature("ForwardTrailingClosures"),
46-
.enableUpcomingFeature("DisableOutwardActorInference"),
47-
.enableExperimentalFeature("StrictConcurrency=complete"),
45+
.enableUpcomingFeature("InferIsolatedConformances"),
46+
//.enableUpcomingFeature("NonisolatedNonsendingByDefault"),
47+
.enableUpcomingFeature("ImmutableWeakCaptures"),
4848
] }

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<a href="https://discord.gg/vapor"><img src="https://design.vapor.codes/images/discordchat.svg" alt="Team Chat"></a>
77
<a href="LICENSE"><img src="https://design.vapor.codes/images/mitlicense.svg" alt="MIT License"></a>
88
<a href="https://github.com/vapor/postgres-kit/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/vapor/postgres-kit/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=%23ccc" alt="Continuous Integration"></a>
9-
<a href="https://codecov.io/github/vapor/postgres-kit"><img src="https://img.shields.io/codecov/c/github/vapor/postgres-kit?style=plastic&logo=codecov&label=codecov"></a>
10-
<a href="https://swift.org"><img src="https://design.vapor.codes/images/swift510up.svg" alt="Swift 5.10+"></a>
9+
<a href="https://codecov.io/github/vapor/postgres-kit"><img src="https://img.shields.io/codecov/c/github/vapor/postgres-kit?style=plastic&logo=codecov&label=codecov" alt="Code Coverage"></a>
10+
<a href="https://swift.org"><img src="https://design.vapor.codes/images/swift60up.svg" alt="Swift 6.0+"></a>
1111
</p>
1212

1313
<br>

Sources/PostgresKit/Docs.docc/theme-settings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"theme": {
3-
"aside": { "border-radius": "16px", "border-style": "double", "border-width": "3px" },
3+
"aside": { "border-radius": "16px", "border-width": "3px", "border-style": "double" },
44
"border-radius": "0",
55
"button": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
66
"code": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" },
77
"color": {
88
"psqlkit": "#336791",
99
"documentation-intro-fill": "radial-gradient(circle at top, var(--color-psqlkit) 30%, #000 100%)",
1010
"documentation-intro-accent": "var(--color-psqlkit)",
11-
"documentation-intro-eyebrow": "white",
11+
"hero-eyebrow": "white",
1212
"documentation-intro-figure": "white",
13-
"documentation-intro-title": "white",
13+
"hero-title": "white",
1414
"logo-base": { "dark": "#fff", "light": "#000" },
1515
"logo-shape": { "dark": "#000", "light": "#fff" },
1616
"fill": { "dark": "#000", "light": "#fff" }

Sources/PostgresKit/PostgresDataTranslation.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ extension URL {
5555
}
5656
}
5757

58-
#if compiler(>=6.0)
5958
extension URL: @retroactive PostgresNonThrowingEncodable, @retroactive PostgresDecodable {}
60-
#else
61-
extension Foundation.URL: PostgresNIO.PostgresNonThrowingEncodable, PostgresNIO.PostgresDecodable {}
62-
#endif
6359

6460
struct PostgresDataTranslation {
6561
/// This typealias serves to limit the deprecation noise caused by `PostgresDataConvertible` to a single

0 commit comments

Comments
 (0)