Skip to content

Commit 4f743ea

Browse files
authored
Merge pull request #4 from pointfreeco/better-ci
Improve CI coverage
2 parents 49d5add + 91b54f5 commit 4f743ea

File tree

9 files changed

+270
-64
lines changed

9 files changed

+270
-64
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ jobs:
1515
strategy:
1616
matrix:
1717
xcode:
18+
- 12.4
1819
- 12.5
20+
- '13.0'
1921
steps:
2022
- uses: actions/checkout@v2
2123
- name: Select Xcode ${{ matrix.xcode }}
2224
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
2325
- name: Print Swift version
2426
run: swift --version
25-
- name: Run tests
27+
- name: Run tests (Swift)
2628
run: make test-swift
29+
- name: Run tests (platforms)
30+
run: make test-platforms
2731

2832
linux:
2933
name: Ubuntu
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "CustomDump"
18+
BuildableName = "CustomDump"
19+
BlueprintName = "CustomDump"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
launchStyle = "0"
38+
useCustomWorkingDirectory = "NO"
39+
ignoresPersistentStateOnLaunch = "NO"
40+
debugDocumentVersioning = "YES"
41+
debugServiceExtension = "internal"
42+
allowLocationSimulation = "YES">
43+
</LaunchAction>
44+
<ProfileAction
45+
buildConfiguration = "Release"
46+
shouldUseLaunchSchemeArgsEnv = "YES"
47+
savedToolIdentifier = ""
48+
useCustomWorkingDirectory = "NO"
49+
debugDocumentVersioning = "YES">
50+
<MacroExpansion>
51+
<BuildableReference
52+
BuildableIdentifier = "primary"
53+
BlueprintIdentifier = "CustomDump"
54+
BuildableName = "CustomDump"
55+
BlueprintName = "CustomDump"
56+
ReferencedContainer = "container:">
57+
</BuildableReference>
58+
</MacroExpansion>
59+
</ProfileAction>
60+
<AnalyzeAction
61+
buildConfiguration = "Debug">
62+
</AnalyzeAction>
63+
<ArchiveAction
64+
buildConfiguration = "Release"
65+
revealArchiveInOrganizer = "YES">
66+
</ArchiveAction>
67+
</Scheme>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1300"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "CustomDump"
18+
BuildableName = "CustomDump"
19+
BlueprintName = "CustomDump"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "CustomDumpTests"
32+
BuildableName = "CustomDumpTests"
33+
BlueprintName = "CustomDumpTests"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
</BuildActionEntries>
38+
</BuildAction>
39+
<TestAction
40+
buildConfiguration = "Debug"
41+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
42+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
shouldUseLaunchSchemeArgsEnv = "YES">
44+
<Testables>
45+
<TestableReference
46+
skipped = "NO">
47+
<BuildableReference
48+
BuildableIdentifier = "primary"
49+
BlueprintIdentifier = "CustomDumpTests"
50+
BuildableName = "CustomDumpTests"
51+
BlueprintName = "CustomDumpTests"
52+
ReferencedContainer = "container:">
53+
</BuildableReference>
54+
</TestableReference>
55+
</Testables>
56+
</TestAction>
57+
<LaunchAction
58+
buildConfiguration = "Debug"
59+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
60+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
61+
launchStyle = "0"
62+
useCustomWorkingDirectory = "NO"
63+
ignoresPersistentStateOnLaunch = "NO"
64+
debugDocumentVersioning = "YES"
65+
debugServiceExtension = "internal"
66+
allowLocationSimulation = "YES">
67+
</LaunchAction>
68+
<ProfileAction
69+
buildConfiguration = "Release"
70+
shouldUseLaunchSchemeArgsEnv = "YES"
71+
savedToolIdentifier = ""
72+
useCustomWorkingDirectory = "NO"
73+
debugDocumentVersioning = "YES">
74+
<MacroExpansion>
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "CustomDump"
78+
BuildableName = "CustomDump"
79+
BlueprintName = "CustomDump"
80+
ReferencedContainer = "container:">
81+
</BuildableReference>
82+
</MacroExpansion>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>

Makefile

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
test-all: test-linux test-swift
1+
PLATFORM_IOS = iOS Simulator,name=iPhone 11 Pro Max
2+
PLATFORM_MACOS = macOS
3+
PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p)
4+
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 4 - 44mm
5+
6+
test-all: test-linux test-swift test-platforms
27

38
test-linux:
49
docker run \
@@ -11,6 +16,41 @@ test-linux:
1116
test-swift:
1217
swift test \
1318
--parallel
19+
swift build \
20+
--configuration release
21+
22+
test-platforms:
23+
xcodebuild test \
24+
-scheme swift-custom-dump \
25+
-destination platform="$(PLATFORM_IOS)"
26+
xcodebuild \
27+
-scheme swift-custom-dump \
28+
-configuration Release \
29+
-destination platform="$(PLATFORM_IOS)"
30+
31+
xcodebuild test \
32+
-scheme swift-custom-dump \
33+
-destination platform="$(PLATFORM_MACOS)"
34+
xcodebuild \
35+
-scheme swift-custom-dump \
36+
-configuration Release \
37+
-destination platform="$(PLATFORM_MACOS)"
38+
39+
xcodebuild test \
40+
-scheme swift-custom-dump \
41+
-destination platform="$(PLATFORM_TVOS)"
42+
xcodebuild \
43+
-scheme swift-custom-dump \
44+
-configuration Release \
45+
-destination platform="$(PLATFORM_TVOS)"
46+
47+
xcodebuild \
48+
-scheme CustomDump_watchOS \
49+
-destination platform="$(PLATFORM_WATCHOS)"
50+
xcodebuild \
51+
-scheme CustomDump_watchOS \
52+
-configuration Release \
53+
-destination platform="$(PLATFORM_WATCHOS)"
1454

1555
format:
1656
swift format --in-place --recursive .

Sources/CustomDump/Conformances/CoreMotion.swift

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,30 @@
3434
}
3535
}
3636
}
37+
#endif
3738

38-
// @available(iOS, unavailable)
39-
// @available(macOS, unavailable)
40-
// @available(tvOS, unavailable)
41-
// @available(watchOS 7.2, *)
42-
// extension CMFallDetectionEvent.UserResolution: CustomDumpStringConvertible {
43-
// public var customDumpDescription: String {
44-
// switch self {
45-
// case .confirmed:
46-
// return "CMFallDetectionEvent.UserResolution.confirmed"
47-
// case .dismissed:
48-
// return "CMFallDetectionEvent.UserResolution.dismissed"
49-
// case .rejected:
50-
// return "CMFallDetectionEvent.UserResolution.rejected"
51-
// case .unresponsive:
52-
// return "CMFallDetectionEvent.UserResolution.unresponsive"
53-
// @unknown default:
54-
// return
55-
// "CMFallDetectionEvent.UserResolution.(@unknown default, rawValue: \(self.rawValue))"
56-
// }
57-
// }
58-
// }
39+
#if compiler(>=5.5)
40+
@available(iOS, unavailable)
41+
@available(macOS, unavailable)
42+
@available(tvOS, unavailable)
43+
@available(watchOS 7.2, *)
44+
extension CMFallDetectionEvent.UserResolution: CustomDumpStringConvertible {
45+
public var customDumpDescription: String {
46+
switch self {
47+
case .confirmed:
48+
return "CMFallDetectionEvent.UserResolution.confirmed"
49+
case .dismissed:
50+
return "CMFallDetectionEvent.UserResolution.dismissed"
51+
case .rejected:
52+
return "CMFallDetectionEvent.UserResolution.rejected"
53+
case .unresponsive:
54+
return "CMFallDetectionEvent.UserResolution.unresponsive"
55+
@unknown default:
56+
return
57+
"CMFallDetectionEvent.UserResolution.(@unknown default, rawValue: \(self.rawValue))"
58+
}
59+
}
60+
}
5961
#endif
6062

6163
extension CMMotionActivityConfidence: CustomDumpStringConvertible {

Sources/CustomDump/Conformances/GameKit.swift

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
#if canImport(GameKit)
22
import GameKit
33

4-
#if compiler(>=5.5)
5-
@available(iOS 14, macOS 11, macCatalyst 14, tvOS 14, *)
6-
extension GKAccessPoint.Location: CustomDumpStringConvertible {
7-
public var customDumpDescription: String {
8-
switch self {
9-
case .bottomLeading:
10-
return "GKAccessPoint.Location.bottomLeading"
11-
case .bottomTrailing:
12-
return "GKAccessPoint.Location.bottomTrailing"
13-
case .topLeading:
14-
return "GKAccessPoint.Location.topLeading"
15-
case .topTrailing:
16-
return "GKAccessPoint.Location.topTrailing"
17-
@unknown default:
18-
return "GKAccessPoint.Location.(@unknown default, rawValue: \(self.rawValue))"
4+
#if !os(watchOS)
5+
#if compiler(>=5.5)
6+
@available(iOS 14, macOS 11, macCatalyst 14, tvOS 14, *)
7+
extension GKAccessPoint.Location: CustomDumpStringConvertible {
8+
public var customDumpDescription: String {
9+
switch self {
10+
case .bottomLeading:
11+
return "GKAccessPoint.Location.bottomLeading"
12+
case .bottomTrailing:
13+
return "GKAccessPoint.Location.bottomTrailing"
14+
case .topLeading:
15+
return "GKAccessPoint.Location.topLeading"
16+
case .topTrailing:
17+
return "GKAccessPoint.Location.topTrailing"
18+
@unknown default:
19+
return "GKAccessPoint.Location.(@unknown default, rawValue: \(self.rawValue))"
20+
}
1921
}
2022
}
21-
}
22-
#endif
23+
#endif
2324

24-
#if !os(watchOS)
2525
@available(iOS 5, macCatalyst 13, macOS 10.8, tvOS 9, *)
26-
@available(watchOS, unavailable)
2726
extension GKPlayer.PhotoSize: CustomDumpStringConvertible {
2827
public var customDumpDescription: String {
2928
switch self {

Sources/CustomDump/Diff.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
/// unchanged lines.
2626
/// - Returns: A string describing any difference detected between values, or `nil` if no difference
2727
/// is detected.
28-
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
2928
public func diff<T>(_ lhs: T, _ rhs: T, format: DiffFormat = .default) -> String? {
3029
var visitedItems: Set<ObjectIdentifier> = []
3130

Tests/CustomDumpTests/DiffTests.swift

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -469,16 +469,18 @@ final class DiffTests: XCTestCase {
469469
}
470470

471471
func testNestedCustomMirror() {
472-
XCTAssertNoDifference(
473-
diff(
474-
NestedDate(date: Date(timeIntervalSince1970: 0)),
475-
NestedDate(date: Date(timeIntervalSince1970: 1))
476-
),
477-
"""
478-
- NestedDate(date: Date(1970-01-01T00:00:00.000Z))
479-
+ NestedDate(date: Date(1970-01-01T00:00:01.000Z))
480-
"""
481-
)
472+
#if compiler(>=5.4)
473+
XCTAssertNoDifference(
474+
diff(
475+
NestedDate(date: Date(timeIntervalSince1970: 0)),
476+
NestedDate(date: Date(timeIntervalSince1970: 1))
477+
),
478+
"""
479+
- NestedDate(date: Date(1970-01-01T00:00:00.000Z))
480+
+ NestedDate(date: Date(1970-01-01T00:00:01.000Z))
481+
"""
482+
)
483+
#endif
482484
}
483485

484486
func testMultilineString() {

0 commit comments

Comments
 (0)