From 5e52a2c2ec6bbb604c035d33f1f09fbff8f65bf3 Mon Sep 17 00:00:00 2001
From: Gwynne Raskind
Date: Thu, 12 Oct 2023 14:06:03 -0500
Subject: [PATCH] Bump required Swift to 5.7, update dependency version
requirements, update CI for Swift and Postgres versions, do some interesting
things with the API docs and README.
---
.github/workflows/test.yml | 49 +++++++++---------
Package.swift | 16 +++---
README.md | 22 +++++---
.../Docs.docc/images/vapor-postgres-logo.svg | 51 +++++++++++++------
.../PostgresNIO/Docs.docc/theme-settings.json | 2 +-
docker-compose.yml | 3 ++
6 files changed, 89 insertions(+), 54 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 2da05f81..91895532 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -18,13 +18,13 @@ jobs:
fail-fast: false
matrix:
swift-image:
- - swift:5.6-focal
- swift:5.7-jammy
- swift:5.8-jammy
- - swiftlang/swift:nightly-5.9-jammy
+ - swift:5.9-jammy
+ - swiftlang/swift:nightly-5.10-jammy
- swiftlang/swift:nightly-main-jammy
include:
- - swift-image: swift:5.8-jammy
+ - swift-image: swift:5.9-jammy
code-coverage: true
container: ${{ matrix.swift-image }}
runs-on: ubuntu-latest
@@ -37,7 +37,7 @@ jobs:
printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}"
swift --version
- name: Check out package
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Run unit tests with Thread Sanitizer
env:
CODE_COVERAGE: ${{ matrix.code-coverage && '--enable-code-coverage' || '' }}
@@ -53,18 +53,18 @@ jobs:
fail-fast: false
matrix:
postgres-image:
- - postgres:15
- - postgres:13
- - postgres:11
+ - postgres:16
+ - postgres:14
+ - postgres:12
include:
- - postgres-image: postgres:15
+ - postgres-image: postgres:16
postgres-auth: scram-sha-256
- - postgres-image: postgres:13
+ - postgres-image: postgres:14
postgres-auth: md5
- - postgres-image: postgres:11
+ - postgres-image: postgres:12
postgres-auth: trust
container:
- image: swift:5.8-jammy
+ image: swift:5.9-jammy
volumes: [ 'pgrunshare:/var/run/postgresql' ]
runs-on: ubuntu-latest
env:
@@ -109,15 +109,15 @@ jobs:
[[ -z "${SWIFT_VERSION}" ]] && SWIFT_VERSION="$(cat /.swift_tag 2>/dev/null || true)"
printf 'OS: %s\nTag: %s\nVersion:\n' "${SWIFT_PLATFORM}-${RUNNER_ARCH}" "${SWIFT_VERSION}" && swift --version
- name: Check out package
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with: { path: 'postgres-nio' }
- name: Run integration tests
run: swift test --package-path postgres-nio --filter=^IntegrationTests
- name: Check out postgres-kit dependent
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with: { repository: 'vapor/postgres-kit', path: 'postgres-kit' }
- name: Check out fluent-postgres-driver dependent
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with: { repository: 'vapor/fluent-postgres-driver', path: 'fluent-postgres-driver' }
- name: Use local package in dependents
run: |
@@ -135,13 +135,13 @@ jobs:
matrix:
postgres-formula:
# Only test one version on macOS, let Linux do the rest
- - postgresql@14
+ - postgresql@15
postgres-auth:
# Only test one auth method on macOS, Linux tests will cover the others
- scram-sha-256
xcode-version:
- '~14.3'
- - '15.0-beta'
+ - '~15.0'
runs-on: macos-13
env:
POSTGRES_HOSTNAME: 127.0.0.1
@@ -164,7 +164,7 @@ jobs:
pg_ctl start --wait
timeout-minutes: 2
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Run all tests
run: swift test
@@ -174,21 +174,24 @@ jobs:
container: swift:jammy
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/766
- - name: Mark the workspace as safe
- run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: API breaking changes
- run: swift package diagnose-api-breaking-changes origin/main
+ run: |
+ git config --global --add safe.directory "${GITHUB_WORKSPACE}"
+ swift package diagnose-api-breaking-changes origin/main
gh-codeql:
runs-on: ubuntu-latest
- permissions: { security-events: write }
+ container: swift:5.8-jammy # CodeQL currently broken with 5.9
+ permissions: { actions: write, contents: read, security-events: write }
steps:
- name: Check out code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
+ - name: Mark repo safe in non-fake global config
+ run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
diff --git a/Package.swift b/Package.swift
index a45925ed..b3ff085c 100644
--- a/Package.swift
+++ b/Package.swift
@@ -1,4 +1,4 @@
-// swift-tools-version:5.6
+// swift-tools-version:5.7
import PackageDescription
let package = Package(
@@ -13,13 +13,13 @@ let package = Package(
.library(name: "PostgresNIO", targets: ["PostgresNIO"]),
],
dependencies: [
- .package(url: "https://github.com/apple/swift-atomics.git", from: "1.1.0"),
- .package(url: "https://github.com/apple/swift-nio.git", from: "2.58.0"),
- .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.18.0"),
- .package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.23.1"),
- .package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "3.0.0"),
- .package(url: "https://github.com/apple/swift-metrics.git", from: "2.0.0"),
- .package(url: "https://github.com/apple/swift-log.git", from: "1.5.2"),
+ .package(url: "https://github.com/apple/swift-atomics.git", from: "1.2.0"),
+ .package(url: "https://github.com/apple/swift-nio.git", from: "2.59.0"),
+ .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.19.0"),
+ .package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.25.0"),
+ .package(url: "https://github.com/apple/swift-crypto.git", "2.0.0" ..< "4.0.0"),
+ .package(url: "https://github.com/apple/swift-metrics.git", from: "2.4.1"),
+ .package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
],
targets: [
.target(
diff --git a/README.md b/README.md
index 2123262f..bca6e82a 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,21 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
🐘 Non-blocking, event-driven Swift client for PostgreSQL built on [SwiftNIO].
@@ -170,7 +180,7 @@ Please see [SECURITY.md] for details on the security process.
[Team Chat]: https://discord.gg/vapor
[MIT License]: LICENSE
[Continuous Integration]: https://github.com/vapor/postgres-nio/actions
-[Swift 5.6]: https://swift.org
+[Swift 5.7]: https://swift.org
[Security.md]: https://github.com/vapor/.github/blob/main/SECURITY.md
[`PostgresConnection`]: https://swiftpackageindex.com/vapor/postgres-nio/documentation/postgresnio/postgresconnection/
diff --git a/Sources/PostgresNIO/Docs.docc/images/vapor-postgres-logo.svg b/Sources/PostgresNIO/Docs.docc/images/vapor-postgres-logo.svg
index d118faab..2b3fe0b1 100644
--- a/Sources/PostgresNIO/Docs.docc/images/vapor-postgres-logo.svg
+++ b/Sources/PostgresNIO/Docs.docc/images/vapor-postgres-logo.svg
@@ -22,20 +22,39 @@
}
PostgresNIO
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/PostgresNIO/Docs.docc/theme-settings.json b/Sources/PostgresNIO/Docs.docc/theme-settings.json
index e9fc3d9d..a8042a54 100644
--- a/Sources/PostgresNIO/Docs.docc/theme-settings.json
+++ b/Sources/PostgresNIO/Docs.docc/theme-settings.json
@@ -18,7 +18,7 @@
},
"color": {
"fill": {
- "dark": "rgb(20, 20, 22)",
+ "dark": "rgb(0, 0, 0)",
"light": "rgb(255, 255, 255)"
},
"psql-blue": "#336791",
diff --git a/docker-compose.yml b/docker-compose.yml
index 68797651..3eff4249 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,6 +10,9 @@ x-shared-config: &shared_config
- 5432:5432
services:
+ psql-16:
+ image: postgres:16
+ <<: *shared_config
psql-15:
image: postgres:15
<<: *shared_config