Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compatibility_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
- os: macos-14
xcode-version: "15.2" # Swift 5.9.2
runs-on: ${{ matrix.os }}
steps:
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
xcode-version: "15.2" # Swift 5.9.2
- os: macos-14
xcode-version: "15.2" # Swift 5.9.2 (minimum supported)
# TODO: drop this once the Swift 6 Sendable/Concurrency warnings
# in the schedulers and test doubles are resolved.
warnings-as-errors: "-Xswiftc -warnings-as-errors"
- os: macos-15
xcode-version: "16.4" # Current Swift
warnings-as-errors: ""
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -28,7 +34,7 @@ jobs:
run: |
swift test \
-c debug \
-Xswiftc -warnings-as-errors \
${{ matrix.warnings-as-errors }} \
--enable-code-coverage \
--build-path .build-test-debug
xcrun llvm-cov show \
Expand All @@ -40,16 +46,15 @@ jobs:
swift test \
-c debug \
--sanitize thread \
-Xswiftc -warnings-as-errors \
${{ matrix.warnings-as-errors }} \
--build-path .build-test-debug-sanitize-thread
- name: Build and run tests in release mode
if: ${{ matrix.xcode-version != '14.3.1' }} # error: no input files specified. See llvm-profdata merge -help
run: |
swift test \
-c release \
-Xswiftc -warnings-as-errors \
${{ matrix.warnings-as-errors }} \
--enable-code-coverage \
--build-path .build-test-release
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
verbose: true
26 changes: 14 additions & 12 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,24 @@ jobs:
strategy:
fail-fast: false
matrix:
swift_version: ["5.9.2"]
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
os_name: focal
- os: ubuntu-22.04
os_name: jammy
runs-on: ${{ matrix.os }}
container: swift:${{ matrix.swift_version }}-${{ matrix.os_name }}
- swift_image: "5.9.2-jammy" # Swift 5.9.2 (minimum supported)
# TODO: drop this once the Swift 6 Sendable/Concurrency warnings
# in the schedulers and test doubles are resolved.
warnings-as-errors: "-Xswiftc -warnings-as-errors"
- swift_image: "6.1-noble" # Current Swift
warnings-as-errors: ""
runs-on: ubuntu-latest
container: swift:${{ matrix.swift_image }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Swift version
run: swift --version
- name: Building and running tests in debug mode with coverage
run: |
swift test \
-c debug \
-Xswiftc -warnings-as-errors \
${{ matrix.warnings-as-errors }} \
--enable-code-coverage \
--build-path .build-test-debug
llvm-cov show \
Expand All @@ -44,8 +46,8 @@ jobs:
run: |
swift test \
-c release \
-Xswiftc -warnings-as-errors \
${{ matrix.warnings-as-errors }} \
--build-path .build-test-release
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
verbose: true
4 changes: 4 additions & 0 deletions Sources/OpenCombine/CombineIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
//

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

#if os(WASI)
private var __identifier: UInt64 = 0
Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenCombine/Helpers/Locking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
//

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

#if os(WASI)
internal struct __UnfairLock { // swiftlint:disable:this type_name
Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenCombine/Publishers/Publishers.Breakpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
#if !os(WASI)

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

extension Publisher {

Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenCombine/Publishers/Publishers.Merge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
// Audited for 2023 Release

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

// MARK: - merge methods on Publisher

Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenCombine/Publishers/Publishers.Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
// Audited for 2023 Release

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

// MARK: - zip methods on Publisher

Expand Down
4 changes: 4 additions & 0 deletions Sources/OpenCombineFoundation/Helpers/Locking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
//

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

import OpenCombine

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ extension OperationQueue {
public struct SchedulerOptions {
}

private final class DelayReadyOperation: Operation, Cancellable {
private final class DelayReadyOperation: Operation, Cancellable, @unchecked Sendable {

fileprivate final class CancellationContext: Cancellable {
let lock = UnfairLock.allocate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ private func makePublisher(

/// A simple mock notification center that always sends notifications to **all**
/// observers in non-thread safe manner.
private final class TestNotificationCenter: NotificationCenter {
private final class TestNotificationCenter: NotificationCenter, @unchecked Sendable {

enum Event {
case postNotificationWithName(Notification.Name, Any?, [AnyHashable : Any]?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ extension OperationQueueScheduler.SchedulerTimeType: DateBackedSchedulerTimeType
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension OperationQueueScheduler: RunLoopLikeScheduler {}

private final class TestOperationQueue: OperationQueue {
private final class TestOperationQueue: OperationQueue, @unchecked Sendable {

enum Event {
case progress
Expand Down
4 changes: 2 additions & 2 deletions Tests/OpenCombineTests/FoundationTests/URLSessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ final class URLSessionTests: XCTestCase {

/// A simple mock URLSession that records its history and allows executing
/// callbacks synchronously
private class TestURLSession: URLSession {
private class TestURLSession: URLSession, @unchecked Sendable {

enum Event: Equatable {
case delegateQueue
Expand Down Expand Up @@ -527,7 +527,7 @@ private class TestURLSession: URLSession {
#endif // canImport(Darwin) && !os(watchOS)
}

private final class TestURLSessionDataTask: URLSessionDataTask {
private final class TestURLSessionDataTask: URLSessionDataTask, @unchecked Sendable {

enum Event: Equatable {
case taskIdentifier
Expand Down
4 changes: 4 additions & 0 deletions Tests/OpenCombineTests/Helpers/AssertCrashes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ import Foundation
import XCTest

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

extension XCTest {

Expand Down
9 changes: 5 additions & 4 deletions Tests/OpenCombineTests/ObservableObjectTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ private final class ObjCClassSubclass: NSObject, ObservableObject {
}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
private class ResilientClassSubclass: JSONDecoder, ObservableObject {
private class ResilientClassSubclass: JSONDecoder, ObservableObject, @unchecked Sendable {
@Published var published0 = 10
@Published var published1 = "hello!"
}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
private final class ResilientClassSubclass2: ResilientClassSubclass {
private final class ResilientClassSubclass2: ResilientClassSubclass, @unchecked Sendable {
@Published var published3 = true
}

Expand Down Expand Up @@ -388,7 +388,8 @@ private class NSObjectSubclass: NSObject, ObservableObject {
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
private class ResilientClassGenericSubclass<Value1, Value2>
: JSONDecoder,
ObservableObject
ObservableObject,
@unchecked Sendable
{
@Published var value1: Value1
@Published var value2: Value2
Expand All @@ -401,7 +402,7 @@ private class ResilientClassGenericSubclass<Value1, Value2>

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
private final class ResilientClassGenericSubclass2<Value1, Value2>
: ResilientClassGenericSubclass<Value1, Value2>
: ResilientClassGenericSubclass<Value1, Value2>, @unchecked Sendable
{
@Published var value3 = false
}
Expand Down
4 changes: 4 additions & 0 deletions Tests/OpenCombineTests/PublisherTests/CatchTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
import XCTest

#if canImport(COpenCombineHelpers)
#if compiler(>=6.0)
internal import COpenCombineHelpers
#else
@_implementationOnly import COpenCombineHelpers
#endif
#endif

#if OPENCOMBINE_COMPATIBILITY_TEST
import Combine
Expand Down
Loading