From f63b1006b3a9e8cc79e2eb3f65226759dcdda2b7 Mon Sep 17 00:00:00 2001 From: Alexander Steiner Date: Mon, 2 Jan 2023 15:52:29 +0100 Subject: [PATCH 1/2] Update GitHub workflows to only use latest Swift and Ubuntu version and remove old LinuxMain.swift file and related code --- .github/workflows/build.yml | 22 +++++-------------- .../GraphiQLVaporTests.swift | 5 ----- .../GraphiQLVaporTests/XCTestManifests.swift | 9 -------- Tests/LinuxMain.swift | 7 ------ 4 files changed, 6 insertions(+), 37 deletions(-) delete mode 100644 Tests/GraphiQLVaporTests/XCTestManifests.swift delete mode 100644 Tests/LinuxMain.swift diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d3693f..f3a642b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,27 +1,17 @@ name: build on: [push, pull_request] jobs: - xenial: - container: - image: swift:xenial + tests: runs-on: ubuntu-latest + container: swift:5.7-jammy steps: - uses: actions/checkout@v1 - run: apt-get -qq update && apt-get -q -y install libpq-dev libssl-dev zlib1g-dev - - run: swift test --enable-test-discovery --sanitize=thread - bionic: - container: - image: swift:bionic + - run: swift test --sanitize=thread + tests-release: runs-on: ubuntu-latest + container: swift:5.7-jammy steps: - uses: actions/checkout@v1 - run: apt-get -qq update && apt-get -q -y install libpq-dev libssl-dev zlib1g-dev - - run: swift test --enable-test-discovery --sanitize=thread - bionic-release: - container: - image: swift:bionic - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - run: apt-get -qq update && apt-get -q -y install libpq-dev libssl-dev zlib1g-dev - - run: swift build -c release + - run: swift test -c release --sanitize=thread diff --git a/Tests/GraphiQLVaporTests/GraphiQLVaporTests.swift b/Tests/GraphiQLVaporTests/GraphiQLVaporTests.swift index 753d252..d0123c4 100644 --- a/Tests/GraphiQLVaporTests/GraphiQLVaporTests.swift +++ b/Tests/GraphiQLVaporTests/GraphiQLVaporTests.swift @@ -25,9 +25,4 @@ final class GraphiQLVaporTests: XCTestCase { XCTAssertEqual(res.status, HTTPResponseStatus.ok) } } - - static var allTests = [ - ("testRegistering", testRegistering), - ("testRegisterOnOtherRoute", testRegisterOnOtherRoute) - ] } diff --git a/Tests/GraphiQLVaporTests/XCTestManifests.swift b/Tests/GraphiQLVaporTests/XCTestManifests.swift deleted file mode 100644 index 478f7b3..0000000 --- a/Tests/GraphiQLVaporTests/XCTestManifests.swift +++ /dev/null @@ -1,9 +0,0 @@ -import XCTest - -#if !canImport(ObjectiveC) -public func allTests() -> [XCTestCaseEntry] { - return [ - testCase(GraphiQLVaporTests.allTests), - ] -} -#endif diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift deleted file mode 100644 index e454400..0000000 --- a/Tests/LinuxMain.swift +++ /dev/null @@ -1,7 +0,0 @@ -import XCTest - -import GraphiQLVaporTests - -var tests = [XCTestCaseEntry]() -tests += GraphiQLVaporTests.allTests() -XCTMain(tests) From be78929fd86e30066184e9161359e23c28f798f2 Mon Sep 17 00:00:00 2001 From: Alexander Steiner Date: Mon, 2 Jan 2023 16:14:16 +0100 Subject: [PATCH 2/2] Update Swift version to 5.4 (same as Vapor itself) and the Readme --- Package.swift | 18 +++++++++--------- README.md | 11 ++++++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Package.swift b/Package.swift index 0773300..a2fb0bf 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.4 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -9,10 +9,7 @@ let package = Package( .macOS(.v10_15) ], products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "GraphiQLVapor", - targets: ["GraphiQLVapor"]), + .library(name: "GraphiQLVapor", targets: ["GraphiQLVapor"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -23,9 +20,12 @@ let package = Package( // Targets can depend on other targets in this package, and on products in packages which this package depends on. .target( name: "GraphiQLVapor", - dependencies: ["Vapor"]), - .testTarget( - name: "GraphiQLVaporTests", - dependencies: ["GraphiQLVapor", "Vapor", "XCTVapor"]), + dependencies: [ + .product(name: "Vapor", package: "vapor"), + ]), + .testTarget(name: "GraphiQLVaporTests", dependencies: [ + .target(name: "GraphiQLVapor"), + .product(name: "XCTVapor", package: "vapor"), + ]), ] ) diff --git a/README.md b/README.md index 392ebe9..9485a41 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # GraphiQLVapor -[![Language](https://img.shields.io/badge/Swift-5.1-brightgreen.svg)](http://swift.org) +[![Language](https://img.shields.io/badge/Swift-5.4-brightgreen.svg)](http://swift.org) [![Vapor Version](https://img.shields.io/badge/Vapor-4-F6CBCA.svg)](http://vapor.codes) [![build](https://github.com/alexsteinerde/graphiql-vapor/workflows/build/badge.svg)](https://github.com/alexsteinerde/graphiql-vapor/actions) @@ -11,10 +11,15 @@ import PackageDescription let package = Package( dependencies: [ - .package(url: "https://github.com/alexsteinerde/graphiql-vapor.git", from: "2.0.0"), + .package(url: "https://github.com/alexsteinerde/graphiql-vapor.git", from: "2.2.0"), ], targets: [ - .target(name: "App", dependencies: ["GraphiQLVapor"]), + .target( + name: "App", + dependencies: [ + .product(name: "GraphiQLVapor", package: "graphiql-vapor"), + ] + ), ... ] )