Skip to content

Commit cdf46f3

Browse files
authored
More CI (#25)
* wip * wip * wip * wip * wip * wip * wip * wip
1 parent ca6a912 commit cdf46f3

File tree

4 files changed

+29
-25
lines changed

4 files changed

+29
-25
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,28 @@ jobs:
3535
strategy:
3636
matrix:
3737
swift:
38+
- 5.3
3839
- 5.4
3940
- 5.5
4041
steps:
4142
- uses: actions/checkout@v2
4243
- name: Run tests
43-
run: make test-linux-${{ matrix.swift }}
44+
run: make test-linux SWIFT_VERSION=${{ matrix.swift }}
4445

4546
windows:
4647
name: Windows
4748
runs-on: windows-latest
49+
strategy:
50+
matrix:
51+
swift:
52+
#- 5.3
53+
- 5.4
54+
- 5.5
4855
timeout-minutes: 30
4956
steps:
5057
- uses: actions/checkout@v2
5158
- name: Install Swift & Run tests
5259
uses: MaxDesiatov/swift-windows-action@v1
5360
with:
54-
shell-action: swift test && swift build -c release
61+
shell-action: swift test && swift build --configuration release
62+
swift-version: ${{ matrix.swift }}

Makefile

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,25 @@ PLATFORM_MACOS = macOS
33
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
44
PLATFORM_TVOS = tvOS Simulator,name=Apple TV 4K (at 1080p)
55
PLATFORM_WATCHOS = watchOS Simulator,name=Apple Watch Series 4 - 44mm
6+
SWIFT_VERSION = 5.5
7+
ifeq ($(SWIFT_VERSION),5.3)
8+
SWIFT_BUILD_ARGS = --enable-test-discovery
9+
endif
10+
SWIFT_TEST_ARGS = --parallel
611

7-
test-all: test-linux-all test-swift test-platforms
12+
test-all: test-linux test-swift test-platforms
813

9-
test-linux-all: test-linux-5.4 test-linux-5.5
10-
11-
test-linux-5.4:
12-
$(call test-linux,5.4)
13-
14-
test-linux-5.5:
15-
$(call test-linux,5.5)
16-
17-
test-linux = docker run \
18-
--rm \
19-
-v "$(PWD):$(PWD)" \
20-
-w "$(PWD)" \
21-
swift:$(1) \
22-
bash -c 'make test-swift'
14+
test-linux:
15+
docker run \
16+
--rm \
17+
-v "$(PWD):$(PWD)" \
18+
-w "$(PWD)" \
19+
swift:$(SWIFT_VERSION) \
20+
bash -c 'make test-swift SWIFT_VERSION=$(SWIFT_VERSION)'
2321

2422
test-swift:
25-
swift test \
26-
--parallel
27-
swift build \
28-
--configuration release
23+
swift test $(SWIFT_BUILD_ARGS) $(SWIFT_TEST_ARGS)
24+
swift build --configuration release $(SWIFT_BUILD_ARGS)
2925

3026
test-platforms:
3127
xcodebuild test \

Sources/CustomDump/Conformances/Foundation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import Foundation
55
#endif
66

77
// NB: Xcode 13 does not include macOS 12 SDK
8-
// NB: Swift 5.5 does not include AttributedString in Linux (yet)
9-
#if compiler(>=5.5) && !os(macOS) && !targetEnvironment(macCatalyst) && !os(Linux)
8+
// NB: Swift 5.5 does not include AttributedString on other platforms (yet)
9+
#if compiler(>=5.5) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS))
1010
@available(iOS 15, macOS 12, tvOS 15, watchOS 8, *)
1111
extension AttributedString: CustomDumpRepresentable {
1212
public var customDumpValue: Any {

Tests/CustomDumpTests/DumpTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ final class DumpTests: XCTestCase {
718718
func testFoundation() {
719719
var dump = ""
720720

721-
#if compiler(>=5.5) && !os(macOS) && !targetEnvironment(macCatalyst) && !os(Linux)
721+
#if compiler(>=5.5) && !targetEnvironment(macCatalyst) && (os(iOS) || os(tvOS) || os(watchOS))
722722
if #available(iOS 15, macOS 12, tvOS 15, watchOS 8, *) {
723723
dump = ""
724724
customDump(
@@ -967,7 +967,7 @@ final class DumpTests: XCTestCase {
967967
DumpTests.(unknown context).(unknown context).BridgedError.thisIsFine(94)
968968
"""
969969
)
970-
#else
970+
#elseif compiler(>=5.4)
971971
// Can't unwrap bridged Errors on Linux: https://bugs.swift.org/browse/SR-15191
972972
XCTAssertNoDifference(
973973
dump.replacingOccurrences(

0 commit comments

Comments
 (0)