From 3d34228c695341b4e7e8f52db466316be7c5dd4c Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Fri, 26 Apr 2024 17:09:15 -0500 Subject: [PATCH] Fix package manifest (#262) * ExistentialAny should not be used in a Package.swift before 5.9 * Minor tidy of CI and DocC catalog --- .github/workflows/test.yml | 41 ++++++++------- Package.swift | 1 - Package@swift-5.9.swift | 50 +++++++++++++++++++ .../vapor-postgreskit-logo.svg | 0 4 files changed, 70 insertions(+), 22 deletions(-) create mode 100644 Package@swift-5.9.swift rename Sources/PostgresKit/Docs.docc/{images => Resources}/vapor-postgreskit-logo.svg (100%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a275081..4bc22a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,6 @@ env: POSTGRES_PASSWORD_B: 'test_password' jobs: - # Check for API breakage versus main api-breakage: if: ${{ github.event_name == 'pull_request' && !(github.event.pull_request.draft || false) }} runs-on: ubuntu-latest @@ -76,26 +75,26 @@ jobs: with: codecov_token: ${{ secrets.CODECOV_TOKEN }} - gh-codeql: - if: ${{ false && !(github.event.pull_request.draft || false) }} - runs-on: ubuntu-latest - container: - image: swift:5.10-jammy - permissions: { actions: write, contents: read, security-events: write } - timeout-minutes: 60 - steps: - - name: Check out code - 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@v3 - with: { languages: swift } - - name: Perform build - run: swift build - - name: Run CodeQL analyze - uses: github/codeql-action/analyze@v3 +# gh-codeql: +# if: ${{ !(github.event.pull_request.draft || false) }} +# runs-on: ubuntu-latest +# container: +# image: swift:5.10-jammy +# permissions: { actions: write, contents: read, security-events: write } +# timeout-minutes: 60 +# steps: +# - name: Check out code +# 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@v3 +# with: { languages: swift } +# - name: Perform build +# run: swift build +# - name: Run CodeQL analyze +# uses: github/codeql-action/analyze@v3 linux-unit: if: ${{ !(github.event.pull_request.draft || false) }} diff --git a/Package.swift b/Package.swift index 7e62357..cc2e74d 100644 --- a/Package.swift +++ b/Package.swift @@ -41,7 +41,6 @@ let package = Package( ) var swiftSettings: [SwiftSetting] { [ - .enableUpcomingFeature("ExistentialAny"), .enableUpcomingFeature("ConciseMagicFile"), .enableUpcomingFeature("ForwardTrailingClosures"), .enableUpcomingFeature("DisableOutwardActorInference"), diff --git a/Package@swift-5.9.swift b/Package@swift-5.9.swift new file mode 100644 index 0000000..a7304ac --- /dev/null +++ b/Package@swift-5.9.swift @@ -0,0 +1,50 @@ +// swift-tools-version:5.9 +import PackageDescription + +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.2"), + .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 + ), + ] +) + +var swiftSettings: [SwiftSetting] { [ + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("ConciseMagicFile"), + .enableUpcomingFeature("ForwardTrailingClosures"), + .enableUpcomingFeature("DisableOutwardActorInference"), + .enableUpcomingFeature("StrictConcurrency"), + .enableExperimentalFeature("StrictConcurrency=complete"), +] } diff --git a/Sources/PostgresKit/Docs.docc/images/vapor-postgreskit-logo.svg b/Sources/PostgresKit/Docs.docc/Resources/vapor-postgreskit-logo.svg similarity index 100% rename from Sources/PostgresKit/Docs.docc/images/vapor-postgreskit-logo.svg rename to Sources/PostgresKit/Docs.docc/Resources/vapor-postgreskit-logo.svg