Skip to content

Commit 88cb316

Browse files
committed
- Move ImmediateScheduler to its own file
- Attempt to fix Linux CI
1 parent 40a2adf commit 88cb316

File tree

3 files changed

+20
-22
lines changed

3 files changed

+20
-22
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,14 @@ jobs:
3838

3939
swiftpm-linux:
4040
name: SwiftPM Linux
41-
runs-on: ubuntu-18.04
41+
runs-on: ubuntu-latest
4242
steps:
4343
- name: Install Swift
4444
run: |
4545
eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
4646
- name: Checkout
4747
uses: actions/checkout@v2
48-
- name: Recover cached dependencies
49-
uses: actions/cache@v1
50-
id: dependency-cache
51-
with:
52-
path: .build
53-
key: swiftpm-linux-${{ hashFiles('Package.resolved') }}
5448
- name: Pull dependencies
55-
if: steps.dependency-cache.outputs.cache-hit != 'true'
5649
run: |
5750
swift package resolve
5851
- name: Test via SwiftPM
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Foundation
2+
import ReactiveSwift
3+
4+
/// Make `ImmediateScheduler` confirm to `DateScheduler`
5+
/// so that it can be used for testing whenever a `DateScheduler`
6+
/// is expected.
7+
extension ImmediateScheduler: DateScheduler {
8+
public var currentDate: Date {
9+
Date(timeIntervalSince1970: 0)
10+
}
11+
12+
public func schedule(after date: Date, action: @escaping () -> Void) -> Disposable? {
13+
schedule(action)
14+
}
15+
16+
public func schedule(after date: Date, interval: DispatchTimeInterval, leeway: DispatchTimeInterval, action: @escaping () -> Void) -> Disposable? {
17+
schedule(action)
18+
}
19+
}

Sources/ComposableArchitecture/TestSupport/TestStore.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -658,17 +658,3 @@
658658
}
659659

660660
#endif
661-
662-
extension ImmediateScheduler: DateScheduler {
663-
public var currentDate: Date {
664-
Date(timeIntervalSince1970: 0)
665-
}
666-
667-
public func schedule(after date: Date, action: @escaping () -> Void) -> Disposable? {
668-
schedule(action)
669-
}
670-
671-
public func schedule(after date: Date, interval: DispatchTimeInterval, leeway: DispatchTimeInterval, action: @escaping () -> Void) -> Disposable? {
672-
schedule(action)
673-
}
674-
}

0 commit comments

Comments
 (0)