Skip to content

Commit 2fcdc8a

Browse files
authored
Merge pull request #2 from rcarver/swift6
swift6
2 parents 41fd42a + b6c492e commit 2fcdc8a

File tree

7 files changed

+91
-28
lines changed

7 files changed

+91
-28
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
mac:
18+
name: macOS
19+
strategy:
20+
matrix:
21+
xcode: ["16.4"]
22+
config: ["debug", "release"]
23+
runs-on: macos-15
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Select Xcode ${{ matrix.xcode }}
27+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
28+
- name: Run ${{ matrix.config }} tests
29+
run: swift test -c ${{ matrix.config }}
30+
31+
linux:
32+
name: Linux
33+
strategy:
34+
matrix:
35+
swift:
36+
- "6.2"
37+
runs-on: ubuntu-latest
38+
container: swift:${{ matrix.swift }}
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Build
42+
run: swift test

.github/workflows/format.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
concurrency:
7+
group: format-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
swift_format:
12+
name: swift-format
13+
runs-on: macos-15
14+
permissions:
15+
contents: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Select Xcode 16.4
19+
run: sudo xcode-select -s /Applications/Xcode_16.4.app
20+
- name: Format
21+
run: make format
22+
- uses: stefanzweifel/git-auto-commit-action@v5
23+
with:
24+
commit_message: Run swift-format
25+
branch: "main"

.github/workflows/swift.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
test:
2+
swift test
3+
4+
format:
5+
find . \
6+
-path '*/Documentation.docc' -prune -o \
7+
-name '*.swift' \
8+
-not -path '*/.*' -print0 \
9+
| xargs -0 xcrun swift-format --ignore-unparsable-files --in-place

Package.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.9
1+
// swift-tools-version: 6.0
22

33
import PackageDescription
44

@@ -13,9 +13,6 @@ let package = Package(
1313
targets: [
1414
.target(
1515
name: "GraphQLPagination",
16-
swiftSettings: [
17-
.enableExperimentalFeature("StrictConcurrency"),
18-
]
1916
),
2017
.testTarget(
2118
name: "GraphQLPaginationTests",

Sources/GraphQLPagination/Connection.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,23 @@ extension BasicConnection {
4040
nodes: [Node],
4141
pagination: any GraphPaginatable,
4242
cursor: CursorType
43-
) where Node: GraphCursorable {
43+
) where Node: GraphCursorable & Sendable {
4444
self.init(nodes: nodes, pagination: pagination.pagination, cursor: cursor)
4545
}
4646
/// Build a connection from nodes for any forward paginatable input.
4747
public init(
4848
nodes: [Node],
4949
pagination: any GraphForwardPaginatable,
5050
cursor: CursorType
51-
) where Node: GraphCursorable {
51+
) where Node: GraphCursorable & Sendable {
5252
self.init(nodes: nodes, pagination: pagination.pagination, cursor: cursor)
5353
}
5454
/// Build a connection from nodes with optional pagination input.
5555
public init(
5656
nodes: [Node],
5757
pagination: GraphPagination?,
5858
cursor: CursorType
59-
) where Node: GraphCursorable {
59+
) where Node: GraphCursorable & Sendable {
6060
let result = EdgeBuilder.build(
6161
cursor: cursor,
6262
nodes: nodes,
@@ -70,5 +70,7 @@ extension BasicConnection {
7070

7171
extension BasicConnection: Codable where Node: Codable {}
7272
extension BasicConnection: Equatable where Node: Equatable {}
73+
extension BasicConnection: Sendable where Node: Sendable {}
7374
extension BasicEdge: Codable where Node: Codable {}
7475
extension BasicEdge: Equatable where Node: Equatable {}
76+
extension BasicEdge: Sendable where Node: Sendable {}

0 commit comments

Comments
 (0)