Skip to content

Commit 8c4ce10

Browse files
authored
[CI] Update package for Swift 6.0+ (#137)
### Motivation: Right now, the nightly CI is failing due to the package relying on old decommissioned Swift toolchains (dev toolchains for 6.0). ### Modifications: Updated the CI setup to be Swift 6.0+, bumped the tools version, but kept the language mode to 5 for now. Bumping of language mode from 5 to 6 can be done in a separate PR, this PR is mainly to unblock nightly CI. ### Result: Fixes nightly CI.
1 parent a05d4bc commit 8c4ce10

6 files changed

Lines changed: 33 additions & 43 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ jobs:
1111
name: Unit tests
1212
uses: ./.github/workflows/unit_tests.yml
1313
with:
14-
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
15-
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
1614
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error"
17-
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
15+
linux_6_1_arguments_override: "--explicit-target-dependency-import-check error"
16+
linux_6_2_arguments_override: "--explicit-target-dependency-import-check error"
1817
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
1918

2019
release-builds:

.github/workflows/pull_request.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ jobs:
1515
name: Unit tests
1616
uses: ./.github/workflows/unit_tests.yml
1717
with:
18-
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
19-
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
2018
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error"
21-
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
19+
linux_6_1_arguments_override: "--explicit-target-dependency-import-check error"
20+
linux_6_2_arguments_override: "--explicit-target-dependency-import-check error"
2221
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
2322

2423
cxx-interop:

.github/workflows/unit_tests.yml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@ name: Unit tests
33
on:
44
workflow_call:
55
inputs:
6-
linux_5_9_enabled:
7-
type: boolean
8-
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to true."
9-
default: true
10-
linux_5_9_arguments_override:
11-
type: string
12-
description: "The arguments passed to swift test in the Linux 5.9 Swift version matrix job."
13-
default: ""
14-
linux_5_10_enabled:
15-
type: boolean
16-
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to true."
17-
default: true
18-
linux_5_10_arguments_override:
19-
type: string
20-
description: "The arguments passed to swift test in the Linux 5.10 Swift version matrix job."
21-
default: ""
226
linux_6_0_enabled:
237
type: boolean
248
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true."
@@ -27,13 +11,21 @@ on:
2711
type: string
2812
description: "The arguments passed to swift test in the Linux 6.0 Swift version matrix job."
2913
default: ""
30-
linux_nightly_6_0_enabled:
14+
linux_6_1_enabled:
15+
type: boolean
16+
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
17+
default: true
18+
linux_6_1_arguments_override:
19+
type: string
20+
description: "The arguments passed to swift test in the Linux 6.1 Swift version matrix job."
21+
default: ""
22+
linux_6_2_enabled:
3123
type: boolean
32-
description: "Boolean to enable the Linux nightly 6.0 Swift version matrix job. Defaults to true."
24+
description: "Boolean to enable the Linux 6.2 Swift version matrix job. Defaults to true."
3325
default: true
34-
linux_nightly_6_0_arguments_override:
26+
linux_6_2_arguments_override:
3527
type: string
36-
description: "The arguments passed to swift test in the Linux nightly 6.0 Swift version matrix job."
28+
description: "The arguments passed to swift test in the Linux 6.2 Swift version matrix job."
3729
default: ""
3830
linux_nightly_main_enabled:
3931
type: boolean
@@ -53,18 +45,15 @@ jobs:
5345
matrix:
5446
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
5547
swift:
56-
- image: "swift:5.9-jammy"
57-
swift_version: "5.9"
58-
enabled: ${{ inputs.linux_5_9_enabled }}
59-
- image: "swift:5.10-jammy"
60-
swift_version: "5.10"
61-
enabled: ${{ inputs.linux_5_10_enabled }}
6248
- image: "swift:6.0-jammy"
6349
swift_version: "6.0"
6450
enabled: ${{ inputs.linux_6_0_enabled }}
65-
- image: "swiftlang/swift:nightly-6.0-jammy"
66-
swift_version: "nightly-6.0"
67-
enabled: ${{ inputs.linux_nightly_6_0_enabled }}
51+
- image: "swift:6.1-jammy"
52+
swift_version: "6.1"
53+
enabled: ${{ inputs.linux_6_1_enabled }}
54+
- image: "swift:6.2-jammy"
55+
swift_version: "6.2"
56+
enabled: ${{ inputs.linux_6_2_enabled }}
6857
- image: "swiftlang/swift:nightly-main-jammy"
6958
swift_version: "nightly-main"
7059
enabled: ${{ inputs.linux_nightly_main_enabled }}
@@ -84,10 +73,9 @@ jobs:
8473
env:
8574
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
8675
COMMAND: "swift test"
87-
COMMAND_OVERRIDE_5_9: "swift test ${{ inputs.linux_5_9_arguments_override }}"
88-
COMMAND_OVERRIDE_5_10: "swift test ${{ inputs.linux_5_10_arguments_override }}"
8976
COMMAND_OVERRIDE_6_0: "swift test ${{ inputs.linux_6_0_arguments_override }}"
90-
COMMAND_OVERRIDE_NIGHTLY_6_0: "swift test ${{ inputs.linux_nightly_6_0_arguments_override }}"
77+
COMMAND_OVERRIDE_6_1: "swift test ${{ inputs.linux_6_1_arguments_override }}"
78+
COMMAND_OVERRIDE_6_2: "swift test ${{ inputs.linux_6_2_arguments_override }}"
9179
COMMAND_OVERRIDE_NIGHTLY_MAIN: "swift test ${{ inputs.linux_nightly_main_arguments_override }}"
9280
REDIS_URL: redis
9381
run: |

Package.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:6.0
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the RediStack open source project
@@ -91,5 +91,8 @@ let package = Package(
9191
.product(name: "NIO", package: "swift-nio"),
9292
]
9393
),
94+
],
95+
swiftLanguageModes: [
96+
.v5
9497
]
9598
)

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![SSWG Sandbox Incubating Badge](https://img.shields.io/badge/sswg-sandbox-lightgrey.svg)][SSWG Incubation]
44
[![Documentation](http://img.shields.io/badge/read_the-docs-2196f3.svg)][Documentation]
55
[![MIT License](http://img.shields.io/badge/license-Apache-brightgreen.svg)][Apache License]
6-
[![Swift 5.6](http://img.shields.io/badge/swift-5.6-brightgreen.svg)][Swift 5.6]
76

87
**RediStack** (pronounced like "ready stack") is a _non-blocking_ Swift client for [Redis](https://redis.io) built on top of [SwiftNIO](https://github.com/apple/swift-nio).
98

@@ -23,7 +22,7 @@ To install **RediStack**, just add the package as a dependency in your **Package
2322

2423
```swift
2524
dependencies: [
26-
.package(url: "https://github.com/swift-server/RediStack.git", from: "1.4.1")
25+
.package(url: "https://github.com/swift-server/RediStack.git", from: "1.6.2")
2726
]
2827
```
2928

Sources/RediStack/ConnectionPool/RedisConnectionPool.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ extension RedisConnectionPool: RedisClientWithUserContext {
381381
}
382382

383383
private func subscribe(
384-
using operation: @escaping (RedisConnection, @escaping RedisSubscriptionChangeHandler, Logger) ->
384+
using operation:
385+
@escaping (RedisConnection, @escaping RedisSubscriptionChangeHandler, Logger) ->
385386
EventLoopFuture<Void>,
386387
onUnsubscribe unsubscribeHandler: RedisSubscriptionChangeHandler?,
387388
context: Logger?
@@ -439,7 +440,8 @@ extension RedisConnectionPool: RedisClientWithUserContext {
439440

440441
@usableFromInline
441442
internal func forwardOperationToConnection<T>(
442-
_ operation: @escaping (RedisConnection, @escaping (RedisConnection, Logger) -> Void, Logger) ->
443+
_ operation:
444+
@escaping (RedisConnection, @escaping (RedisConnection, Logger) -> Void, Logger) ->
443445
EventLoopFuture<T>,
444446
preferredConnection: RedisConnection?,
445447
context: Logger?

0 commit comments

Comments
 (0)