From 805dd3aa7fbe38043f966a5cfebfdcdd97ff0293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Tue, 28 Jan 2025 15:33:29 +0100 Subject: [PATCH 01/14] Swift6 compilation mode support --- Package.resolved | 61 +++++++++---------- Package.swift | 15 ++--- .../FlowPilot/Coordinators/Coordinator.swift | 7 +-- .../ResponseRouterCoordinator.swift | 13 ++-- .../Coordinators/RouterCoordinator.swift | 2 +- .../FlowPilot/shouldAnimateTransition.swift | 1 + .../FloatingPanelDelegate.swift | 2 +- .../Router+.swift | 14 +++-- 8 files changed, 61 insertions(+), 54 deletions(-) diff --git a/Package.resolved b/Package.resolved index 57d0bbb..6c568ee 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,34 +1,33 @@ { - "object": { - "pins": [ - { - "package": "CleevioCore", - "repositoryURL": "https://github.com/cleevio/CleevioCore.git", - "state": { - "branch": null, - "revision": "593b5d1011ad0aa6963ea2d8bf2ddc5e59caa917", - "version": "2.1.7" - } - }, - { - "package": "FloatingPanel", - "repositoryURL": "https://github.com/scenee/FloatingPanel", - "state": { - "branch": null, - "revision": "2a29cb5b3ecf4beb67cf524a030dd74a11b956c4", - "version": "2.6.1" - } - }, - { - "package": "swift-collections", - "repositoryURL": "https://github.com/apple/swift-collections", - "state": { - "branch": null, - "revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", - "version": "1.0.4" - } + "originHash" : "39b241a30b0e760088db9cb72b444525c2da0e7ffcf66fffc862f2e57c3a8d6d", + "pins" : [ + { + "identity" : "cleeviocore", + "kind" : "remoteSourceControl", + "location" : "https://github.com/cleevio/CleevioCore.git", + "state" : { + "revision" : "593b5d1011ad0aa6963ea2d8bf2ddc5e59caa917", + "version" : "2.1.7" } - ] - }, - "version": 1 + }, + { + "identity" : "floatingpanel", + "kind" : "remoteSourceControl", + "location" : "https://github.com/scenee/FloatingPanel", + "state" : { + "revision" : "b6e8928b1a3ad909e6db6a0278d286c33cfd0dc3", + "version" : "2.8.6" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections", + "state" : { + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" + } + } + ], + "version" : 3 } diff --git a/Package.swift b/Package.swift index 904c20e..2b85ede 100644 --- a/Package.swift +++ b/Package.swift @@ -1,15 +1,15 @@ -// swift-tools-version: 5.5 +// swift-tools-version: 6.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let swiftSettings: [SwiftSetting] = [ // Use for development to catch concurrency issues. SPM packages cannot depend on other packages that use unsafeFlags. -// SwiftSetting.unsafeFlags([ -// "-Xfrontend", "-strict-concurrency=complete", -// "-Xfrontend", "-warn-concurrency", -// "-Xfrontend", "-enable-actor-data-race-checks", -// ]) + SwiftSetting.unsafeFlags([ + "-Xfrontend", "-strict-concurrency=complete", + "-Xfrontend", "-warn-concurrency", + "-Xfrontend", "-enable-actor-data-race-checks", + ]) ] let package = Package( @@ -54,5 +54,6 @@ let package = Package( dependencies: ["FlowPilot"], swiftSettings: swiftSettings ), - ] + ], + swiftLanguageModes: [.v5, .v6] ) diff --git a/Sources/FlowPilot/Coordinators/Coordinator.swift b/Sources/FlowPilot/Coordinators/Coordinator.swift index 50650d9..c2bc0bd 100644 --- a/Sources/FlowPilot/Coordinators/Coordinator.swift +++ b/Sources/FlowPilot/Coordinators/Coordinator.swift @@ -80,7 +80,7 @@ open class Coordinator: CoordinatorEventDelegate { #if canImport(UIKit) final public var options: Options = .default - public struct Options: OptionSet { + public struct Options: OptionSet, Sendable { public let rawValue: UInt8 public init(rawValue: UInt8) { @@ -118,9 +118,8 @@ open class Coordinator: CoordinatorEventDelegate { deinit { let typeOfSelf = Self.self - let identifier = self.identifier - - Task { @MainActor [eventDelegate] in + + Task { @MainActor [eventDelegate, identifier] in eventDelegate?.onDeinit(of: typeOfSelf, identifier: identifier) } } diff --git a/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift b/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift index 65315c4..8c871b3 100644 --- a/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift +++ b/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift @@ -21,7 +21,8 @@ import Combine /// - `deinit` /// Sends a failure due to cancellation when the handler is deinitialized. @available(macOS 10.15, *) -open class ResponseHandler { +@MainActor +open class ResponseHandler { private let responseStream = PassthroughSubject() private var cancellable: AnyCancellable? @@ -33,7 +34,9 @@ open class ResponseHandler { } deinit { - self.handleResult(.failure(CancellationError())) + Task { @MainActor [handleResult] in + handleResult(.failure(CancellationError())) + } } /// Asynchronously retrieves a response value or throws an error if encountered. @@ -128,10 +131,12 @@ public protocol ResponseRoutingDelegate: AnyObject { @MainActor open class ResponseRouterCoordinator: RouterCoordinator, ResponseRoutingDelegate { /// An optional closure that takes a `Result` to handle the result of a response. - public var onResponse: ((Result) -> Void)? + public var onResponse: (@Sendable @MainActor (Result) -> Void)? deinit { - onResponse?(.failure(CancellationError())) + Task { @MainActor [onResponse] in + onResponse?(.failure(CancellationError())) + } } /// Sends a successful response to the `onResponse` closure. diff --git a/Sources/FlowPilot/Coordinators/RouterCoordinator.swift b/Sources/FlowPilot/Coordinators/RouterCoordinator.swift index df1de03..c5dad68 100644 --- a/Sources/FlowPilot/Coordinators/RouterCoordinator.swift +++ b/Sources/FlowPilot/Coordinators/RouterCoordinator.swift @@ -32,7 +32,7 @@ open class RouterCoordinator: Coordinator { } @inlinable - open func coordinate(to coordinator: ResponseRouterCoordinator, animated: Bool = true) + open func coordinate(to coordinator: sending ResponseRouterCoordinator, animated: Bool = true) -> ResponseHandler { let responseHandler = ResponseHandler() diff --git a/Sources/FlowPilot/shouldAnimateTransition.swift b/Sources/FlowPilot/shouldAnimateTransition.swift index 2721f06..458d63d 100644 --- a/Sources/FlowPilot/shouldAnimateTransition.swift +++ b/Sources/FlowPilot/shouldAnimateTransition.swift @@ -8,6 +8,7 @@ #if canImport(UIKit) import UIKit @inlinable +@MainActor public func shouldAnimateTransition(preference: Bool, respectsUserReduceMotion: Bool) -> Bool { preference && (respectsUserReduceMotion ? !UIAccessibility.isReduceMotionEnabled : true) } diff --git a/Sources/FlowPilotFloatingRouters/FloatingPanelDelegate.swift b/Sources/FlowPilotFloatingRouters/FloatingPanelDelegate.swift index e7de34c..0a2dde2 100644 --- a/Sources/FlowPilotFloatingRouters/FloatingPanelDelegate.swift +++ b/Sources/FlowPilotFloatingRouters/FloatingPanelDelegate.swift @@ -33,7 +33,7 @@ open class FloatingPanelDelegate { } } -extension FloatingPanelDelegate: FloatingPanelControllerDelegate { +extension FloatingPanelDelegate: @preconcurrency FloatingPanelControllerDelegate { @MainActor public func floatingPanelDidChangeState(_ fpc: FloatingPanel.FloatingPanelController) { handleFloatingPanelState(fpc.state) } diff --git a/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift b/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift index b0c78bd..40d3e8c 100644 --- a/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift +++ b/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift @@ -8,7 +8,7 @@ import UIKit import Combine import CleevioCore -import FlowPilot +@preconcurrency import FlowPilot @available(*, deprecated, message: "It is expected to use new coordinators from now on") public enum RouterResult { @@ -54,16 +54,18 @@ extension RouterResult: Equatable { @available(*, deprecated, message: "It is expected to use new coordinators from now on") public protocol LegacyRouter: AnyObject, DismissHandler { - func present(_ viewController: UIViewController, animated: Bool) - func dismiss(animated: Bool, completion: (() -> Void)?) - func dismiss(animated: Bool, returning result: RouterResult) -> AnyPublisher, Never> + @MainActor func present(_ viewController: UIViewController, animated: Bool) + @MainActor func dismiss(animated: Bool, completion: (() -> Void)?) + @MainActor func dismiss(animated: Bool, returning result: RouterResult) -> AnyPublisher, Never> } public extension LegacyRouter { + @MainActor func dismiss(animated: Bool, returning result: RouterResult) -> AnyPublisher, Never> { Future { [weak self] promise in - self?.dismiss(animated: animated) { - promise(.success(result)) + let dismissAction = { promise(.success(result)) } + Task { @MainActor in + self?.dismiss(animated: animated) { promise(.success(result)) } } } .eraseToAnyPublisher() From 8e2c78a83f63200162d73978690274687452108a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Tue, 28 Jan 2025 15:39:09 +0100 Subject: [PATCH 02/14] Support Swift 5.5 --- Package.swift | 9 +------ Package@swift-5.5.swift | 59 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 Package@swift-5.5.swift diff --git a/Package.swift b/Package.swift index 2b85ede..bcef3be 100644 --- a/Package.swift +++ b/Package.swift @@ -3,14 +3,7 @@ import PackageDescription -let swiftSettings: [SwiftSetting] = [ - // Use for development to catch concurrency issues. SPM packages cannot depend on other packages that use unsafeFlags. - SwiftSetting.unsafeFlags([ - "-Xfrontend", "-strict-concurrency=complete", - "-Xfrontend", "-warn-concurrency", - "-Xfrontend", "-enable-actor-data-race-checks", - ]) -] +let swiftSettings: [SwiftSetting] = [ ] let package = Package( name: "FlowPilot", diff --git a/Package@swift-5.5.swift b/Package@swift-5.5.swift new file mode 100644 index 0000000..f81e6df --- /dev/null +++ b/Package@swift-5.5.swift @@ -0,0 +1,59 @@ +// swift-tools-version: 5.5 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let swiftSettings: [SwiftSetting] = [ + // Use for development to catch concurrency issues. SPM packages cannot depend on other packages that use unsafeFlags. +// SwiftSetting.unsafeFlags([ +// "-Xfrontend", "-strict-concurrency=complete", +// "-Xfrontend", "-warn-concurrency", +// "-Xfrontend", "-enable-actor-data-race-checks", +// ]) +] + +let package = Package( + name: "FlowPilot", + platforms: [ + .iOS(.v13) + ], + products: [ + .library( + name: "FlowPilot", + targets: ["FlowPilot"]), + .library(name: "FlowPilotFloatingRouters", targets: ["FlowPilotFloatingRouters"]), + .library(name: "FlowPilotLegacyCombineCoordinators", targets: ["FlowPilotLegacyCombineCoordinators"]) + ], + dependencies: [ + .package(url: "https://github.com/cleevio/CleevioCore.git", .upToNextMajor(from: Version(2,0,0))), + .package(url: "https://github.com/scenee/FloatingPanel", .upToNextMajor(from: Version(2,6,1))), + .package(url: "https://github.com/apple/swift-collections", .upToNextMajor(from: Version(1,0,0))) + ], + targets: [ + .target( + name: "FlowPilot", + dependencies: [ + .product(name: "CleevioCore", package: "CleevioCore"), + .product(name: "OrderedCollections", package: "swift-collections") + ], + swiftSettings: swiftSettings + ), + .target(name: "FlowPilotFloatingRouters", dependencies: [ + "FlowPilot", + .product(name: "FloatingPanel", package: "FloatingPanel", condition: .when(platforms: [.iOS, .macCatalyst])) + ], + swiftSettings: swiftSettings + ), + .target(name: "FlowPilotLegacyCombineCoordinators", dependencies: [ + "FlowPilot", + .product(name: "CleevioCore", package: "CleevioCore") + ] + ), + .testTarget( + name: "FlowPilotTests", + dependencies: ["FlowPilot"], + swiftSettings: swiftSettings + ), + ], + swiftLanguageModes: [.v5, .v6] +) From 7f7e571756428a0c8a0db543ea9128bb3330341f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Thu, 30 Jan 2025 08:43:03 +0100 Subject: [PATCH 03/14] Fix responseHandler not being deallocated --- Sources/FlowPilot/Coordinators/RouterCoordinator.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/FlowPilot/Coordinators/RouterCoordinator.swift b/Sources/FlowPilot/Coordinators/RouterCoordinator.swift index c5dad68..91cd40a 100644 --- a/Sources/FlowPilot/Coordinators/RouterCoordinator.swift +++ b/Sources/FlowPilot/Coordinators/RouterCoordinator.swift @@ -37,8 +37,8 @@ open class RouterCoordinator: Coordinator { { let responseHandler = ResponseHandler() - coordinator.onResponse = { result in - responseHandler.handleResult(result) + coordinator.onResponse = { [weak responseHandler] result in + responseHandler?.handleResult(result) } super.coordinate( From a01881c865d78accc75be1e15d674fc6aa046e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Thu, 30 Jan 2025 08:48:25 +0100 Subject: [PATCH 04/14] Weakly catching self in response handler --- .../FlowPilot/Coordinators/ResponseRouterCoordinator.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift b/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift index 8c871b3..16ef245 100644 --- a/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift +++ b/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift @@ -43,9 +43,8 @@ open class ResponseHandler { /// - Throws: An error if the response stream completes with a failure. /// - Returns: The response value upon successful completion. public func response() async throws -> Response { - try await withUnsafeThrowingContinuation { continuation in - cancellable = - responseStream + try await withUnsafeThrowingContinuation { [weak self, responseStream] continuation in + self?.cancellable = responseStream .first() .sink { completion in guard case .failure(let error) = completion else { return } From f3e7977e1bd124a39104c8e38322f25a8449375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Thu, 30 Jan 2025 09:33:53 +0100 Subject: [PATCH 05/14] Fixing response handler concurrency issue --- .../ResponseRouterCoordinator.swift | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift b/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift index 16ef245..5da0a33 100644 --- a/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift +++ b/Sources/FlowPilot/Coordinators/ResponseRouterCoordinator.swift @@ -21,8 +21,7 @@ import Combine /// - `deinit` /// Sends a failure due to cancellation when the handler is deinitialized. @available(macOS 10.15, *) -@MainActor -open class ResponseHandler { +open class ResponseHandler: @unchecked Sendable { private let responseStream = PassthroughSubject() private var cancellable: AnyCancellable? @@ -34,8 +33,8 @@ open class ResponseHandler { } deinit { - Task { @MainActor [handleResult] in - handleResult(.failure(CancellationError())) + Task { @MainActor [responseStream] in + Self.handleResult(.failure(CancellationError()), on: responseStream) } } @@ -43,8 +42,8 @@ open class ResponseHandler { /// - Throws: An error if the response stream completes with a failure. /// - Returns: The response value upon successful completion. public func response() async throws -> Response { - try await withUnsafeThrowingContinuation { [weak self, responseStream] continuation in - self?.cancellable = responseStream + try await withUnsafeThrowingContinuation { [responseStream] continuation in + self.cancellable = responseStream .first() .sink { completion in guard case .failure(let error) = completion else { return } @@ -55,9 +54,13 @@ open class ResponseHandler { } } + public func handleResult(_ result: Result) { + Self.handleResult(result, on: responseStream) + } + /// Processes a result, either sending a success value or a failure completion to the stream. /// - Parameter result: A result value of type `Result`. - public func handleResult(_ result: Result) { + private static func handleResult(_ result: Result, on responseStream: PassthroughSubject) { switch result { case let .success(response): responseStream.send(response) From 5931f6fc1476b8ffa075d859fe6355d2513d52f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:33:07 +0100 Subject: [PATCH 06/14] MR fix --- Package.resolved | 61 ++++++++++--------- .../Router+.swift | 1 - 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Package.resolved b/Package.resolved index 6c568ee..57d0bbb 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,33 +1,34 @@ { - "originHash" : "39b241a30b0e760088db9cb72b444525c2da0e7ffcf66fffc862f2e57c3a8d6d", - "pins" : [ - { - "identity" : "cleeviocore", - "kind" : "remoteSourceControl", - "location" : "https://github.com/cleevio/CleevioCore.git", - "state" : { - "revision" : "593b5d1011ad0aa6963ea2d8bf2ddc5e59caa917", - "version" : "2.1.7" + "object": { + "pins": [ + { + "package": "CleevioCore", + "repositoryURL": "https://github.com/cleevio/CleevioCore.git", + "state": { + "branch": null, + "revision": "593b5d1011ad0aa6963ea2d8bf2ddc5e59caa917", + "version": "2.1.7" + } + }, + { + "package": "FloatingPanel", + "repositoryURL": "https://github.com/scenee/FloatingPanel", + "state": { + "branch": null, + "revision": "2a29cb5b3ecf4beb67cf524a030dd74a11b956c4", + "version": "2.6.1" + } + }, + { + "package": "swift-collections", + "repositoryURL": "https://github.com/apple/swift-collections", + "state": { + "branch": null, + "revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", + "version": "1.0.4" + } } - }, - { - "identity" : "floatingpanel", - "kind" : "remoteSourceControl", - "location" : "https://github.com/scenee/FloatingPanel", - "state" : { - "revision" : "b6e8928b1a3ad909e6db6a0278d286c33cfd0dc3", - "version" : "2.8.6" - } - }, - { - "identity" : "swift-collections", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-collections", - "state" : { - "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", - "version" : "1.1.4" - } - } - ], - "version" : 3 + ] + }, + "version": 1 } diff --git a/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift b/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift index 40d3e8c..2027963 100644 --- a/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift +++ b/Sources/FlowPilotLegacyCombineCoordinators/Router+.swift @@ -63,7 +63,6 @@ public extension LegacyRouter { @MainActor func dismiss(animated: Bool, returning result: RouterResult) -> AnyPublisher, Never> { Future { [weak self] promise in - let dismissAction = { promise(.success(result)) } Task { @MainActor in self?.dismiss(animated: animated) { promise(.success(result)) } } From f8a4a5084637dc6b422afff671398666c75aef39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:33:14 +0100 Subject: [PATCH 07/14] Supporting Swift6 --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 5645dcd..c0c980c 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -15,7 +15,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v4 + - uses: swift-actions/setup-swift@v2 - name: Build run: swift build -v - name: Run tests From c9fa7b4c98f89b40ab1b04f0561d368ad2272ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:36:51 +0100 Subject: [PATCH 08/14] Specifying swift version --- .github/workflows/swift.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index c0c980c..30fe422 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.0.0" - name: Build run: swift build -v - name: Run tests From 50876ba116a57d0934be3d9bbfd501652606fe02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:38:58 +0100 Subject: [PATCH 09/14] Setup Swift version using swift-actions --- .github/workflows/swift.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 30fe422..c676a68 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -16,8 +16,9 @@ jobs: steps: - uses: swift-actions/setup-swift@v2 - with: - swift-version: "6.0.0" + - name: Get swift version + run: swift --version + - uses: swift-actions/setup-swift@v2 - name: Build run: swift build -v - name: Run tests From 2666f4dfabcce608d8c029b7efaf95759a595c78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:39:52 +0100 Subject: [PATCH 10/14] Updated run --- .github/workflows/swift.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index c676a68..36cc29b 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -18,8 +18,7 @@ jobs: - uses: swift-actions/setup-swift@v2 - name: Get swift version run: swift --version - - uses: swift-actions/setup-swift@v2 - name: Build - run: swift build -v + run: swift build -v - name: Run tests - run: swift test -v + run: swift test -v From 792aa5a3810017d852398fcb468c977229113a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:41:37 +0100 Subject: [PATCH 11/14] Improved indentation --- .github/workflows/swift.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 36cc29b..30b93c1 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -11,14 +11,12 @@ on: jobs: build: - runs-on: macos-latest - steps: - - uses: swift-actions/setup-swift@v2 - - name: Get swift version + - uses: swift-actions/setup-swift@v2 + - name: Get swift version run: swift --version - - name: Build + - name: Build run: swift build -v - - name: Run tests + - name: Run tests run: swift test -v From 0c8f1687c9b2ca68aa2f85e392e63cfabccf4af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:43:49 +0100 Subject: [PATCH 12/14] Specify Swift version --- .github/workflows/swift.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 30b93c1..38b3614 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -14,6 +14,7 @@ jobs: runs-on: macos-latest steps: - uses: swift-actions/setup-swift@v2 + with: swift-version: "6" - name: Get swift version run: swift --version - name: Build From 455822b7753643dba22c888dba58b037c8f5a6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:44:42 +0100 Subject: [PATCH 13/14] Indentation --- .github/workflows/swift.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 38b3614..d5c6196 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -14,7 +14,8 @@ jobs: runs-on: macos-latest steps: - uses: swift-actions/setup-swift@v2 - with: swift-version: "6" + with: + swift-version: "6" - name: Get swift version run: swift --version - name: Build From 7b42589b7e21256fa62629fe0dd25b4095280644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=CC=81s=CC=8C=20Valenta?= Date: Mon, 17 Feb 2025 11:51:19 +0100 Subject: [PATCH 14/14] Update checkout --- .github/workflows/swift.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index d5c6196..049ad6d 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -13,12 +13,19 @@ jobs: build: runs-on: macos-latest steps: - - uses: swift-actions/setup-swift@v2 + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Swift + uses: swift-actions/setup-swift@v2 with: - swift-version: "6" + swift-version: "6" + - name: Get swift version run: swift --version + - name: Build run: swift build -v + - name: Run tests run: swift test -v