-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* The usual round of various package cleanup * Fix mishandling of Foundation.URL by PostgresDataTranslation, including support for the broken encoding we were previously generating. * Apply suggestions from code review * Disable CodeQL for now --------- Co-authored-by: Mahdi Bahrami <[email protected]>
- Loading branch information
Showing
15 changed files
with
250 additions
and
89 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
groups: | ||
dependencies: | ||
patterns: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,23 +25,41 @@ env: | |
jobs: | ||
# Check for API breakage versus main | ||
api-breakage: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
if: ${{ github.event_name == 'pull_request' && !(github.event.pull_request.draft || false) }} | ||
runs-on: ubuntu-latest | ||
container: swift:jammy | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: { 'fetch-depth': 0 } | ||
- name: Run API breakage check action | ||
uses: vapor/ci/.github/actions/ci-swift-check-api-breakage@main | ||
- name: API breaking changes | ||
run: | | ||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | ||
swift package diagnose-api-breaking-changes origin/main | ||
dependency-graph: | ||
if: ${{ github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
container: swift:jammy | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Fix Git configuration | ||
run: | | ||
git config --global --add safe.directory "${GITHUB_WORKSPACE}" | ||
apt-get update && apt-get install -y curl | ||
- name: Submit dependency graph | ||
uses: vapor-community/[email protected] | ||
|
||
code-coverage: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
runs-on: ubuntu-latest | ||
container: swift:jammy | ||
services: | ||
psql-a: | ||
image: postgres:15 | ||
image: postgres:16 | ||
env: | ||
POSTGRES_USER: test_username | ||
POSTGRES_DB: test_database | ||
|
@@ -50,58 +68,60 @@ jobs: | |
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Run unit tests for coverage data | ||
run: swift test --enable-code-coverage | ||
- name: Upload coverage data | ||
uses: vapor/[email protected] | ||
|
||
gh-codeql: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runner_os: | ||
- ubuntu-latest | ||
- macos-13 | ||
runs-on: ${{ matrix.runner_os }} | ||
permissions: | ||
security-events: write | ||
if: ${{ false && !(github.event.pull_request.draft || false) }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: swift:5.9-jammy | ||
permissions: { actions: write, contents: read, security-events: write } | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Select appropriate Xcode version | ||
if: ${{ startsWith(matrix.runner_os, 'macos') }} | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: { xcode-version: '~14.3' } | ||
- 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: Check Swift compatibility | ||
id: swift-check | ||
uses: vapor/ci/.github/actions/check-compatible-swift@main | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }} | ||
uses: github/codeql-action/init@v3 | ||
with: { languages: swift } | ||
- name: Perform build | ||
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }} | ||
run: swift build | ||
- name: Run CodeQL analyze | ||
uses: github/codeql-action/analyze@v2 | ||
if: ${{ steps.swift-check.outputs.swift-compatible == 'true' }} | ||
uses: github/codeql-action/analyze@v3 | ||
|
||
linux-unit: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
postgres-image: | ||
- postgres:15 | ||
- postgres:13 | ||
- postgres:11 | ||
- postgres:16 | ||
- postgres:14 | ||
- postgres:12 | ||
swift-image: | ||
- 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: | ||
- 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 | ||
runs-on: ubuntu-latest | ||
container: ${{ matrix.swift-image }} | ||
|
@@ -116,17 +136,17 @@ jobs: | |
POSTGRES_INITDB_ARGS: --auth-host=${{ matrix.postgres-auth }} | ||
steps: | ||
- name: Check out package | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Run local tests | ||
run: swift test | ||
|
||
linux-integration: | ||
if: ${{ !(github.event.pull_request.draft || false) }} | ||
runs-on: ubuntu-latest | ||
container: swift:5.8-jammy | ||
container: swift:5.9-jammy | ||
services: | ||
psql-a: | ||
image: postgres:15 | ||
image: postgres:16 | ||
env: | ||
POSTGRES_USER: test_username | ||
POSTGRES_DB: test_database | ||
|
@@ -143,10 +163,10 @@ jobs: | |
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256 | ||
steps: | ||
- name: Check out package | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: { 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 | ||
run: swift package --package-path fluent-postgres-driver edit postgres-kit --path postgres-kit | ||
|
@@ -158,10 +178,12 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
xcode-version: | ||
- '~14.3' | ||
- '15.0-beta' | ||
runs-on: macos-13 | ||
include: | ||
- macos-version: macos-13 | ||
xcode-version: '~14.3' | ||
- macos-version: macos-14 | ||
xcode-version: latest | ||
runs-on: ${{ matrix.macos-version }} | ||
env: | ||
POSTGRES_HOSTNAME: 127.0.0.1 | ||
POSTGRES_DB: postgres | ||
|
@@ -173,11 +195,11 @@ jobs: | |
- name: Install Postgres, setup DB and auth, and wait for server start | ||
run: | | ||
export PATH="$(brew --prefix)/opt/postgresql@14/bin:$PATH" PGDATA=/tmp/vapor-postgres-test | ||
(brew unlink postgresql || true) && brew install "postgresql@14" && brew link --force "postgresql@14" | ||
(brew unlink postgresql || true) && brew install "postgresql@15" && brew link --force "postgresql@15" | ||
initdb --locale=C --auth-host "scram-sha-256" -U "${POSTGRES_USER}" --pwfile=<(echo "${POSTGRES_PASSWORD}") | ||
pg_ctl start --wait | ||
timeout-minutes: 2 | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Run local tests | ||
run: swift test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// swift-tools-version:5.9 | ||
import PackageDescription | ||
|
||
let swiftSettings: [SwiftSetting] = [ | ||
.enableUpcomingFeature("ExistentialAny"), | ||
.enableUpcomingFeature("ConciseMagicFile"), | ||
.enableUpcomingFeature("ForwardTrailingClosures"), | ||
.enableUpcomingFeature("DisableOutwardActorInference"), | ||
.enableExperimentalFeature("StrictConcurrency=complete"), | ||
] | ||
|
||
let package = Package( | ||
name: "postgres-kit", | ||
platforms: [ | ||
.macOS(.v10_15), | ||
.iOS(.v13), | ||
.watchOS(.v6), | ||
.tvOS(.v13), | ||
], | ||
products: [ | ||
.library(name: "PostgresKit", targets: ["PostgresKit"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/vapor/postgres-nio.git", from: "1.20.0"), | ||
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.28.0"), | ||
.package(url: "https://github.com/vapor/async-kit.git", from: "1.19.0"), | ||
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.2.0") | ||
], | ||
targets: [ | ||
.target( | ||
name: "PostgresKit", | ||
dependencies: [ | ||
.product(name: "AsyncKit", package: "async-kit"), | ||
.product(name: "PostgresNIO", package: "postgres-nio"), | ||
.product(name: "SQLKit", package: "sql-kit"), | ||
.product(name: "Atomics", package: "swift-atomics"), | ||
], | ||
swiftSettings: swiftSettings | ||
), | ||
.testTarget( | ||
name: "PostgresKitTests", | ||
dependencies: [ | ||
.target(name: "PostgresKit"), | ||
.product(name: "SQLKitBenchmark", package: "sql-kit"), | ||
], | ||
swiftSettings: swiftSettings | ||
), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Sources/PostgresKit/Docs.docc/images/vapor-postgreskit-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"theme": { | ||
"aside": { "border-radius": "6px", "border-style": "double", "border-width": "3px" }, | ||
"border-radius": "0", | ||
"button": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" }, | ||
"code": { "border-radius": "16px", "border-width": "1px", "border-style": "solid" }, | ||
"color": { | ||
"psqlkit": "#336791", | ||
"documentation-intro-fill": "radial-gradient(circle at top, var(--color-psqlkit) 30%, #000 100%)", | ||
"documentation-intro-accent": "var(--color-psqlkit)", | ||
"logo-base": { "dark": "#fff", "light": "#000" }, | ||
"logo-shape": { "dark": "#000", "light": "#fff" }, | ||
"fill": { "dark": "#000", "light": "#fff" } | ||
}, | ||
"icons": { "technology": "/postgreskit/images/vapor-postgreskit-logo.svg" } | ||
}, | ||
"features": { | ||
"quickNavigation": { "enable": true }, | ||
"i18n": { "enable": true } | ||
} | ||
} |
Oops, something went wrong.