Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update minimum Swift requirement to 5.7 #414

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' || '' }}
Expand All @@ -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:
Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.6
// swift-tools-version:5.7
import PackageDescription

let package = Package(
Expand All @@ -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(
Expand Down
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
</picture>
<br>
<br>
<a name="https://www.swift.org/sswg/incubation-process.html"><img src="https://img.shields.io/badge/sswg-graduated-green.svg" alt="SSWG Incubation Level: Graduated"></a>
<a href="https://api.vapor.codes/postgresnio/documentation/postgresnio/"><img src="https://img.shields.io/badge/read_the-docs-2196f3.svg" alt="Documentation"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg" alt="MIT License"></a>
<a href="https://github.com/vapor/postgres-nio/actions/workflows/test.yml"><img src="https://github.com/vapor/postgres-nio/actions/workflows/test.yml/badge.svg" alt="Continuous Integration"></a>
<a href="https://swift.org"><img src="https://img.shields.io/badge/swift-5.6-brightgreen.svg" alt="Swift 5.6"></a>
<a href="https://api.vapor.codes/postgresnio/documentation/postgresnio/">
<img src="https://img.shields.io/badge/read_the-docs-2196f3.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIxLjQiIHk9IjIuMzUiIHdpZHRoPSIxMy4yIiBoZWlnaHQ9IjkuOCIgc3R5bGU9ImZpbGw6ICNkZmRiZjM7IG9wYWNpdHk6IDAuMzMzMzM7Ii8+PHBhdGggc3R5bGU9ImZpbGw6ICNmZmY7IiBkPSJNMCwxLjc1YzAsLTAuNCAwLjM1LC0wLjg1IDAuNzUsLTAuODVjMi43LDAgNS4yNSwtMC42IDcuMjUsMS40YzIsLTIgNC4yNSwtMS40IDcuMjUsLTEuNGMwLjQsMCAwLjc1LDAuNCAwLjc1LDAuODV2MTAuNWMwLDAuNCAtMC4zNSwwLjc1IC0wLjc1LDAuNzVjLTIuNSwwIC00LjgsLTAuNiAtNi43NSwxLjNjLTAuMjUsMC4yNSAtMC43NSwwLjI1IC0xLDBjLTEuNzUsLTEuNyAtNC40NSwtMS4zIC02Ljc1LC0xLjNjLTAuNCwwIC0wLjc1LC0wLjM1IC0wLjc1LC0wLjc1em03LjI1LDEwLjI1di03LjI1Yy0wLjA4LC0yLjk1IC0zLjYsLTIuMjUgLTUuNzUsLTIuMjV2OWMxLjk1LDAgMy45NSwtMC4zIDUuNzUsMC41em0xLjUsLTcuMjV2Ny4yNWMxLjc1LC0wLjg1IDMuODUsLTAuNSA1Ljc1LC0wLjV2LTljLTIuMjUsMCAtNS43NSwtMC43IC01Ljc1LDIuMjV6Ii8+PC9zdmc+Cg==&labelColor=gray" alt="Documentation">
</a>
<a href="LICENSE">
<img src="https://img.shields.io/badge/license-MIT-skyblue?style=flat&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNNzAuNTQsMTEuNTJjLS4xLTMuODktMTEuOS0zLjg5LTEyLDB2MTBjLTUuMjcuMTgtMjAuMzYsNy44NS0yNC40Niw4aC0xOC4zOGMtMS42LDAtNS43NTcsMi40NS01LjY5LDYuMDhjLjEsNC41NCw0LjcxLDYuNjUsOS4xOSw1LjkyYzAsMC0xNC45NTcsMzMuMTgtMTYuODgsMzcuNTJjLTMuMzcyLDcuNjEsMTIuNDcsMTQuOTcsMjIuOSwxNC43MmMxMS44LS42LDI2LjEyLTcuMzEsMjIuODYtMTMuOTJjLTIuNS01LjA3LTE2LjY4LTM4LjMyLTE2LjY4LTM4LjMyYzUuNzEsMCwxOC4zNy03Ljg1LDI3LjE0LTh2NzYuNzhoLTIwYy0zLjkxLDAtMy45MSwxMiwwLDEyaDUyYzMuOTEsMCwzLjkxLTEyLDAtMTJoLTIwdi03Ni43OGM4LjctLjEsMjEuMTQsNy45NywyNy4zNCw4YzAsMC0xNC40MSwzMi44NC0xNi44OCwzOC4zMmMtMi43MSw2LDExLjYxLDEzLjkyLDIyLjksMTMuOTJjMTEuOCwwLDI2LjEtNi4zNywyMi45LTEzLjkyYy0yLjItNS4zMS0xNi45LTM4LjMyLTE2LjktMzguMzJjNC44LjQ1LDkuNi0xLjU3LDkuNi01LjkyYy0uMS00LjYtNC02LjA5LTYuMS02LjA4YzAsMC0yMi43OS0uMi0xOC40LDBjMCwwLTE4Ljk4LTcuOTQtMjQuNDYtOHptMzIuODYsNDQuNjQsMTAuNCwyNGMtMy44LDEuNzMtMTguNTksMS4xMi0yMC44NCwwem0tNzcuNywwLDEwLjQ0LDI0Yy04LjAyLDMuMjgtMTUuMDEsMi45MS0yMC44NCwwYzAsMCwxMC4zNi0yMy45NiwxMC40LTI0eiIvPjwvc3ZnPgo%3D" alt="MIT License">
</a>
<a href="https://github.com/vapor/postgres-nio/actions/workflows/test.yml">
<img src="https://github.com/vapor/postgres-nio/actions/workflows/test.yml/badge.svg" alt="Continuous Integration">
</a>
<a href="https://swift.org">
<img src="https://img.shields.io/badge/swift-5.7%2b-white?style=flat&logo=swift&logoColor=%23f07158&labelColor=gray&color=%23f07158" alt="Swift 5.7 - 5.9">
</a>
<a name="https://www.swift.org/sswg/incubation-process.html">
<img src="https://img.shields.io/badge/sswg-graduated-white.svg?logo=data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImIiPjxzdG9wIHN0b3AtY29sb3I9IiNmZDIwMjAiIHN0eWxlPSJzdG9wLWNvbG9yOiNlMDE1OTUiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNmODhhMzYiIHN0eWxlPSJzdG9wLWNvbG9yOiNhNTNmOGEiIG9mZnNldD0iLjY5OSIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJjIiB4MT0iNDIzIiB4Mj0iNzMiIHkxPSI3MyIgeTI9IjQyMyIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSg4LDgpIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgaHJlZj0iI2IiLz48L2RlZnM+PGZpbHRlciBpZD0iYSIgeD0iLS4wNDQ0NyIgeT0iLS4wNDQ0NyI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0xMDIuMS03Ny44IDQuMiA2LjMgOC40IDEzLjQgMTQgMTkuMSAyNi44IDM0LjcgNjIuOCA3Ny4yIDEwNSAxMDkuN2wwLjEgMC4xYy0yOS43IDE4LjQtNzIgMTkuOC0xMTQuMi0wLjEtMTAuNi00LjktMjAuNC0xMC42LTI4LjktMTcuNyAxNy42IDI4LjMgNDUuMSA1My4xIDc4LjIgNjcuMyA0MC45IDE3LjYgODEuNiAxNS44IDExMS4xLTEuMyAxNC40LTYuMSA0Mi43LTE1LjMgNTggMTQuNyAzLjUgNy4xIDExLjMtMzAuNC0xNi45LTY1LjgtMC4yLTAuMi0wLjMtMC40LTAuNS0wLjYgMC40LTEuNCAwLjgtMi45IDEuMi00LjQgMTQuMS01NC41LTE5LjctMTE5LjYtNzYuOC0xNTQuM3oiIHN0eWxlPSJmaWxsOnVybCgjZCkiLz48L3N2Zz4K&labelColor=gray&color=%23e01595" alt="SSWG Incubation Level: Graduated">
</a>
</p>
<br>
🐘 Non-blocking, event-driven Swift client for PostgreSQL built on [SwiftNIO].
Expand Down Expand Up @@ -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/
Expand Down
51 changes: 35 additions & 16 deletions Sources/PostgresNIO/Docs.docc/images/vapor-postgres-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Sources/PostgresNIO/Docs.docc/theme-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"color": {
"fill": {
"dark": "rgb(20, 20, 22)",
"dark": "rgb(0, 0, 0)",
"light": "rgb(255, 255, 255)"
},
"psql-blue": "#336791",
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down