Skip to content

Commit 545a092

Browse files
committed
Swift Language Support: Drop <5.9, Add 6.0
1 parent 42e2ad3 commit 545a092

File tree

4 files changed

+61
-27
lines changed

4 files changed

+61
-27
lines changed

.github/workflows/ci.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,31 @@ concurrency:
1616
jobs:
1717
library:
1818
name: macOS
19+
runs-on: macos-14
1920
strategy:
2021
matrix:
21-
xcode: ['14.3.1']
22+
xcode: ['15.4']
2223
config: ['debug', 'release']
23-
runs-on: macos-13
2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
- name: Select Xcode ${{ matrix.xcode }}
2727
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
2828
- name: Run ${{ matrix.config }} tests
2929
run: CONFIG=${{ matrix.config }} make test
3030

3131
linux:
3232
name: Linux
33+
runs-on: ubuntu-latest
3334
strategy:
3435
matrix:
35-
os: [ubuntu-20.04]
3636
config: ['debug', 'release']
37-
runs-on: ${{ matrix.os }}
37+
swift:
38+
- '5.10'
39+
name: Linux (Swift ${{ matrix.swift }})
40+
runs-on: ubuntu-latest
41+
container: swift:${{ matrix.swift }}
3842
steps:
39-
- uses: actions/checkout@v3
40-
- name: Build
41-
run: swift build
43+
- uses: actions/checkout@v4
4244
- name: Run tests
4345
run: swift test -c ${{ matrix.config }}
4446

@@ -48,9 +50,9 @@ jobs:
4850
strategy:
4951
matrix:
5052
include:
51-
- { toolchain: wasm-5.7.1-RELEASE }
53+
- { toolchain: wasm-5.9.2-RELEASE }
5254
steps:
53-
- uses: actions/checkout@v3
55+
- uses: actions/checkout@v4
5456
- run: echo "${{ matrix.toolchain }}" > .swift-version
5557
- uses: swiftwasm/[email protected]
5658
with:
@@ -66,9 +68,9 @@ jobs:
6668
steps:
6769
- uses: compnerd/gha-setup-swift@main
6870
with:
69-
branch: swift-5.8-release
70-
tag: 5.8-RELEASE
71+
branch: swift-5.10-release
72+
tag: 5.10-RELEASE
7173

72-
- uses: actions/checkout@v3
74+
- uses: actions/checkout@v4
7375
- name: Run tests
7476
run: swift build -c ${{ matrix.config }}

Package.swift

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.6
1+
// swift-tools-version: 5.9
22

33
import PackageDescription
44

@@ -36,14 +36,9 @@ let package = Package(
3636
)
3737
#endif
3838

39-
//for target in package.targets {
40-
// target.swiftSettings = target.swiftSettings ?? []
41-
// target.swiftSettings?.append(
42-
// .unsafeFlags([
43-
// "-c", "release",
44-
// "-emit-module-interface", "-enable-library-evolution",
45-
// "-Xfrontend", "-warn-concurrency",
46-
// "-Xfrontend", "-enable-actor-data-race-checks",
47-
// ])
48-
// )
49-
//}
39+
for target in package.targets {
40+
target.swiftSettings = target.swiftSettings ?? []
41+
target.swiftSettings!.append(contentsOf: [
42+
.enableExperimentalFeature("StrictConcurrency")
43+
])
44+
}

[email protected]

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "swift-concurrency-extras",
7+
platforms: [
8+
.iOS(.v13),
9+
.macOS(.v10_15),
10+
.tvOS(.v13),
11+
.watchOS(.v6),
12+
],
13+
products: [
14+
.library(
15+
name: "ConcurrencyExtras",
16+
targets: ["ConcurrencyExtras"]
17+
)
18+
],
19+
targets: [
20+
.target(
21+
name: "ConcurrencyExtras"
22+
),
23+
.testTarget(
24+
name: "ConcurrencyExtrasTests",
25+
dependencies: [
26+
"ConcurrencyExtras"
27+
]
28+
),
29+
]
30+
)
31+
32+
#if !os(Windows)
33+
// Add the documentation compiler plugin if possible
34+
package.dependencies.append(
35+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
36+
)
37+
#endif

Tests/ConcurrencyExtrasTests/AsyncStreamTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@available(iOS 15, *)
66
private let sendable: @Sendable () async -> AsyncStream<Void> = {
7-
await NotificationCenter.default
7+
NotificationCenter.default
88
.notifications(named: UIApplication.userDidTakeScreenshotNotification)
99
.map { _ in }
1010
.eraseToStream()
@@ -20,7 +20,7 @@
2020

2121
@available(iOS 15, *)
2222
private let sendableThrowing: @Sendable () async -> AsyncThrowingStream<Void, Error> = {
23-
await NotificationCenter.default
23+
NotificationCenter.default
2424
.notifications(named: UIApplication.userDidTakeScreenshotNotification)
2525
.map { _ in }
2626
.eraseToThrowingStream()

0 commit comments

Comments
 (0)