From 4aaa372f13320eb4eb22bdd640d310c3b922d143 Mon Sep 17 00:00:00 2001 From: Ryan Carver Date: Fri, 19 Sep 2025 14:24:57 -0700 Subject: [PATCH 1/7] swift 6 --- Package.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Package.swift b/Package.swift index 2d54c64..36f03ef 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 import PackageDescription @@ -13,9 +13,6 @@ let package = Package( targets: [ .target( name: "GraphQLPagination", - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency"), - ] ), .testTarget( name: "GraphQLPaginationTests", From 96466f719d7bd1363b0563b88aece4988f3b216b Mon Sep 17 00:00:00 2001 From: Ryan Carver Date: Fri, 19 Sep 2025 14:25:02 -0700 Subject: [PATCH 2/7] BasicConnection conditonally Sendable --- Sources/GraphQLPagination/Connection.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/GraphQLPagination/Connection.swift b/Sources/GraphQLPagination/Connection.swift index 86aac35..eed4ca1 100644 --- a/Sources/GraphQLPagination/Connection.swift +++ b/Sources/GraphQLPagination/Connection.swift @@ -70,5 +70,7 @@ extension BasicConnection { extension BasicConnection: Codable where Node: Codable {} extension BasicConnection: Equatable where Node: Equatable {} +extension BasicConnection: Sendable where Node: Sendable {} extension BasicEdge: Codable where Node: Codable {} extension BasicEdge: Equatable where Node: Equatable {} +extension BasicEdge: Sendable where Node: Sendable {} From b132933d0b0129c96da394eedbd6fd6fb0990127 Mon Sep 17 00:00:00 2001 From: Ryan Carver Date: Fri, 19 Sep 2025 14:25:41 -0700 Subject: [PATCH 3/7] editorconfig --- .editorconfig | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..410ff6c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +# editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true From 65c21e2078dfce1632239ad91be9ec77abfda1d9 Mon Sep 17 00:00:00 2001 From: Ryan Carver Date: Fri, 19 Sep 2025 14:28:56 -0700 Subject: [PATCH 4/7] require sendable for transform --- Sources/GraphQLPagination/Connection.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/GraphQLPagination/Connection.swift b/Sources/GraphQLPagination/Connection.swift index eed4ca1..c7d2566 100644 --- a/Sources/GraphQLPagination/Connection.swift +++ b/Sources/GraphQLPagination/Connection.swift @@ -40,7 +40,7 @@ extension BasicConnection { nodes: [Node], pagination: any GraphPaginatable, cursor: CursorType - ) where Node: GraphCursorable { + ) where Node: GraphCursorable & Sendable { self.init(nodes: nodes, pagination: pagination.pagination, cursor: cursor) } /// Build a connection from nodes for any forward paginatable input. @@ -48,7 +48,7 @@ extension BasicConnection { nodes: [Node], pagination: any GraphForwardPaginatable, cursor: CursorType - ) where Node: GraphCursorable { + ) where Node: GraphCursorable & Sendable { self.init(nodes: nodes, pagination: pagination.pagination, cursor: cursor) } /// Build a connection from nodes with optional pagination input. @@ -56,7 +56,7 @@ extension BasicConnection { nodes: [Node], pagination: GraphPagination?, cursor: CursorType - ) where Node: GraphCursorable { + ) where Node: GraphCursorable & Sendable { let result = EdgeBuilder.build( cursor: cursor, nodes: nodes, From 4138f8546e51ec59c4a26376cde140eae0ee9bec Mon Sep 17 00:00:00 2001 From: Ryan Carver Date: Fri, 19 Sep 2025 14:29:07 -0700 Subject: [PATCH 5/7] Makefile --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c924aad --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +test: + swift test + +format: + find . \ + -path '*/Documentation.docc' -prune -o \ + -name '*.swift' \ + -not -path '*/.*' -print0 \ + | xargs -0 xcrun swift-format --ignore-unparsable-files --in-place From 46a2dbfd5798e8c9bd7fab4b830517ca18833b45 Mon Sep 17 00:00:00 2001 From: Ryan Carver Date: Fri, 19 Sep 2025 14:32:53 -0700 Subject: [PATCH 6/7] update workflows --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++ .github/workflows/format.yml | 25 +++++++++++++++++++++ .github/workflows/swift.yml | 21 ------------------ 3 files changed, 67 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/format.yml delete mode 100644 .github/workflows/swift.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..84c81be --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - "*" + workflow_dispatch: + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + mac: + name: macOS + strategy: + matrix: + xcode: ["16.4"] + config: ["debug", "release"] + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + - name: Select Xcode ${{ matrix.xcode }} + run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app + - name: Run ${{ matrix.config }} tests + run: swift test -c ${{ matrix.config }} + + linux: + name: Linux + strategy: + matrix: + swift: + - "6.0" + runs-on: ubuntu-latest + container: swift:${{ matrix.swift }} + steps: + - uses: actions/checkout@v4 + - name: Build + run: swift test diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..84a7d6c --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,25 @@ +on: + push: + branches: + - main + +concurrency: + group: format-${{ github.ref }} + cancel-in-progress: true + +jobs: + swift_format: + name: swift-format + runs-on: macos-15 + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - name: Select Xcode 16.4 + run: sudo xcode-select -s /Applications/Xcode_16.4.app + - name: Format + run: make format + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Run swift-format + branch: "main" diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml deleted file mode 100644 index 796f2bd..0000000 --- a/.github/workflows/swift.yml +++ /dev/null @@ -1,21 +0,0 @@ -# This workflow will build a Swift project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift - -name: Swift - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - test-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: swift-actions/setup-swift@v1 - with: - swift-version: 5.9 - - name: Run tests - run: swift test -v From b6c492e52960bf0eaa194cee2e47bff6d1f5f149 Mon Sep 17 00:00:00 2001 From: Ryan Carver Date: Fri, 19 Sep 2025 14:34:41 -0700 Subject: [PATCH 7/7] fix swift version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84c81be..c6d6fec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: strategy: matrix: swift: - - "6.0" + - "6.2" runs-on: ubuntu-latest container: swift:${{ matrix.swift }} steps: