Skip to content

Commit de5f1a9

Browse files
authored
Merge 75f4a08 into 27d8920
2 parents 27d8920 + 75f4a08 commit de5f1a9

File tree

12 files changed

+428
-448
lines changed

12 files changed

+428
-448
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
xcode-build-12:
15-
name: Xcode 12 Build
16-
runs-on: macOS-11
14+
xcode-build-13:
15+
name: Xcode 13 Build
16+
runs-on: macOS-12
1717
strategy:
1818
matrix:
1919
platforms: [
20-
'iOS_14',
21-
'tvOS_14',
22-
'watchOS_7',
23-
'iOS_13',
24-
'tvOS_13',
25-
'watchOS_6',
20+
'iOS_15',
21+
'tvOS_15',
2622
]
2723
fail-fast: false
2824
timeout-minutes: 30
@@ -32,23 +28,21 @@ jobs:
3228
- name: Bundle Install
3329
run: bundle install
3430
- name: Select Xcode Version
35-
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
36-
- name: Prepare Simulator Runtimes
37-
run: Scripts/github/prepare-simulators.sh ${{ matrix.platforms }}
31+
run: sudo xcode-select --switch /Applications/Xcode_13.4.1.app/Contents/Developer
3832
- name: Build and Test Framework
3933
run: Scripts/build.swift ${{ matrix.platforms }} xcode
4034
- name: Upload Coverage Reports
4135
if: success()
4236
run: Scripts/upload-coverage-reports.sh ${{ matrix.platforms }}
43-
xcode-build-13:
44-
name: Xcode 13 Build
45-
runs-on: macOS-12
37+
xcode-build-14:
38+
name: Xcode 14 Build
39+
runs-on: macOS-14
4640
strategy:
4741
matrix:
4842
platforms: [
49-
'iOS_15',
50-
'tvOS_15',
51-
'watchOS_8',
43+
'iOS_16',
44+
'tvOS_16',
45+
'watchOS_9',
5246
]
5347
fail-fast: false
5448
timeout-minutes: 30
@@ -58,7 +52,7 @@ jobs:
5852
- name: Bundle Install
5953
run: bundle install
6054
- name: Select Xcode Version
61-
run: sudo xcode-select --switch /Applications/Xcode_13.4.1.app/Contents/Developer
55+
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
6256
- name: Build and Test Framework
6357
run: Scripts/build.swift ${{ matrix.platforms }} xcode
6458
- name: Upload Coverage Reports
@@ -70,9 +64,6 @@ jobs:
7064
strategy:
7165
matrix:
7266
platforms: [
73-
'iOS_16',
74-
'tvOS_16',
75-
'watchOS_9',
7667
'iOS_17',
7768
'tvOS_17',
7869
'watchOS_10',
@@ -119,40 +110,6 @@ jobs:
119110
run: brew outdated carthage || brew upgrade carthage
120111
- name: Build Framework
121112
run: carthage build --verbose --no-skip-current --use-xcframeworks
122-
spm-11:
123-
name: SPM Build macOS 11
124-
runs-on: macOS-11
125-
timeout-minutes: 30
126-
strategy:
127-
matrix:
128-
platforms: [
129-
'iOS_14',
130-
'tvOS_14',
131-
'watchOS_7',
132-
'iOS_13',
133-
'tvOS_13',
134-
'watchOS_6',
135-
'macOS_11',
136-
]
137-
fail-fast: false
138-
steps:
139-
- name: Checkout Repo
140-
uses: actions/checkout@v4
141-
- name: Bundle Install
142-
run: bundle install
143-
- name: Select Xcode Version
144-
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
145-
if: ${{ matrix.platforms == 'iOS_14,tvOS_14,watchOS_7' }}
146-
- name: Select Xcode Version
147-
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
148-
if: ${{ matrix.platforms == 'iOS_13,tvOS_13,watchOS_6' }}
149-
- name: Select Xcode Version
150-
run: sudo xcode-select --switch /Applications/Xcode_12.5.1.app/Contents/Developer
151-
if: ${{ matrix.platforms == 'macOS_11' }}
152-
- name: Prepare Simulator Runtimes
153-
run: Scripts/github/prepare-simulators.sh ${{ matrix.platforms }}
154-
- name: Build Framework
155-
run: Scripts/build.swift ${{ matrix.platforms }} spm
156113
spm-12:
157114
name: SPM Build macOS 12
158115
runs-on: macOS-12
@@ -196,7 +153,7 @@ jobs:
196153
- name: Bundle Install
197154
run: bundle install
198155
- name: Select Xcode Version
199-
run: sudo xcode-select --switch /Applications/Xcode_14.3.app/Contents/Developer
156+
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
200157
- name: Prepare Simulator Runtimes
201158
run: Scripts/github/prepare-simulators.sh ${{ matrix.platforms }}
202159
- name: Build Framework

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Valet guarantees that reading and writing operations will succeed as long as wri
239239
240240
## Requirements
241241
242-
* Xcode 12.5 or later.
242+
* Xcode 13.0 or later.
243243
* iOS 9 or later.
244244
* tvOS 9 or later.
245245
* watchOS 2 or later.

Scripts/build.swift

Lines changed: 18 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -21,131 +21,75 @@ enum TaskError: Error {
2121
}
2222

2323
enum Platform: String, CustomStringConvertible {
24-
case iOS_13
25-
case iOS_14
2624
case iOS_15
2725
case iOS_16
2826
case iOS_17
29-
case tvOS_13
30-
case tvOS_14
3127
case tvOS_15
3228
case tvOS_16
3329
case tvOS_17
34-
case macOS_11
3530
case macOS_12
3631
case macOS_13
3732
case macOS_14
38-
case watchOS_6
39-
case watchOS_7
4033
case watchOS_8
4134
case watchOS_9
4235
case watchOS_10
4336

4437
var destination: String {
4538
switch self {
46-
case .iOS_13:
47-
return "platform=iOS Simulator,OS=13.7,name=iPad Pro (12.9-inch) (4th generation)"
48-
case .iOS_14:
49-
return "platform=iOS Simulator,OS=14.4,name=iPad Pro (12.9-inch) (4th generation)"
5039
case .iOS_15:
5140
return "platform=iOS Simulator,OS=15.5,name=iPad Pro (12.9-inch) (5th generation)"
5241
case .iOS_16:
5342
return "platform=iOS Simulator,OS=16.4,name=iPad Pro (12.9-inch) (6th generation)"
5443
case .iOS_17:
5544
return "platform=iOS Simulator,OS=17.4,name=iPad Pro (12.9-inch) (6th generation)"
5645

57-
case .tvOS_13:
58-
return "platform=tvOS Simulator,OS=13.4,name=Apple TV"
59-
case .tvOS_14:
60-
return "platform=tvOS Simulator,OS=14.3,name=Apple TV"
6146
case .tvOS_15:
6247
return "platform=tvOS Simulator,OS=15.4,name=Apple TV"
6348
case .tvOS_16:
6449
return "platform=tvOS Simulator,OS=16.4,name=Apple TV"
6550
case .tvOS_17:
6651
return "platform=tvOS Simulator,OS=17.4,name=Apple TV"
6752

68-
case .macOS_11,
69-
.macOS_12,
53+
case .macOS_12,
7054
.macOS_13,
7155
.macOS_14:
7256
return "platform=OS X"
7357

74-
case .watchOS_6:
75-
return "OS=6.2.1,name=Apple Watch Series 4 - 44mm"
76-
case .watchOS_7:
77-
return "OS=7.2,name=Apple Watch Series 6 - 44mm"
7858
case .watchOS_8:
7959
return "OS=8.5,name=Apple Watch Series 6 - 44mm"
8060
case .watchOS_9:
81-
return "OS=9.4,name=Apple Watch Series 6 - 44mm"
61+
return "OS=9.4,name=Apple Watch Series 6 (44mm)"
8262
case .watchOS_10:
83-
return "OS=10.4,name=Apple Watch Series 6 - 44mm"
63+
return "OS=10.4,name=Apple Watch Series 9 (45mm)"
8464
}
8565
}
8666

8767
var sdk: String {
8868
switch self {
89-
case .iOS_13,
90-
.iOS_14,
91-
.iOS_15,
69+
case .iOS_15,
9270
.iOS_16,
9371
.iOS_17:
9472
return "iphonesimulator"
9573

96-
case .tvOS_13,
97-
.tvOS_14,
98-
.tvOS_15,
74+
case .tvOS_15,
9975
.tvOS_16,
10076
.tvOS_17:
10177
return "appletvsimulator"
10278

103-
case .macOS_11:
104-
return "macosx11.1"
10579
case .macOS_12:
10680
return "macosx12.3"
10781
case .macOS_13:
10882
return "macosx13.3"
10983
case .macOS_14:
110-
return "macosx14.0"
84+
return "macosx14.4"
11185

112-
case .watchOS_6,
113-
.watchOS_7,
114-
.watchOS_8,
86+
case .watchOS_8,
11587
.watchOS_9,
11688
.watchOS_10:
11789
return "watchsimulator"
11890
}
11991
}
12092

121-
var shouldTest: Bool {
122-
switch self {
123-
case .iOS_13,
124-
.iOS_14,
125-
.iOS_15,
126-
.iOS_16,
127-
.iOS_17,
128-
.tvOS_13,
129-
.tvOS_14,
130-
.tvOS_15,
131-
.tvOS_16,
132-
.tvOS_17,
133-
.macOS_11,
134-
.macOS_12,
135-
.macOS_13,
136-
.macOS_14,
137-
.watchOS_8,
138-
.watchOS_9,
139-
.watchOS_10:
140-
return true
141-
142-
case .watchOS_6,
143-
.watchOS_7:
144-
// watchOS did not support unit testing prior to Xcode 12.5.
145-
return false
146-
}
147-
}
148-
14993
/// Whether the platform's Xcode version requires modern SPM integration in xcodebuild, given the removal of generate-xcodeproj.
15094
var requiresModernSPMIntegration: Bool {
15195
switch self {
@@ -163,29 +107,22 @@ enum Platform: String, CustomStringConvertible {
163107

164108
var scheme: String {
165109
switch self {
166-
case .iOS_13,
167-
.iOS_14,
168-
.iOS_15,
110+
case .iOS_15,
169111
.iOS_16,
170112
.iOS_17:
171113
return "Valet iOS"
172114

173-
case .tvOS_13,
174-
.tvOS_14,
175-
.tvOS_15,
115+
case .tvOS_15,
176116
.tvOS_16,
177117
.tvOS_17:
178118
return "Valet tvOS"
179119

180-
case .macOS_11,
181-
.macOS_12,
120+
case .macOS_12,
182121
.macOS_13,
183122
.macOS_14:
184123
return "Valet Mac"
185124

186-
case .watchOS_6,
187-
.watchOS_7,
188-
.watchOS_8,
125+
case .watchOS_8,
189126
.watchOS_9,
190127
.watchOS_10:
191128
return "Valet watchOS"
@@ -271,27 +208,27 @@ enum Task: String, CustomStringConvertible {
271208
// Our Package isn't set up with unit test targets, because SPM can't run unit tests in a codesigned environment.
272209
return false
273210
case .xcode:
274-
return platform.shouldTest
211+
return true
275212
}
276213
}
277214
}
278215

279216
guard CommandLine.arguments.count > 2 else {
280217
print("Usage: build.swift platforms [spm|xcode]")
281-
exit(0)
218+
throw TaskError.code(1)
282219
}
283220
let rawPlatforms = CommandLine.arguments[1].components(separatedBy: ",")
284221
let rawTask = CommandLine.arguments[2]
285222

286223
guard let task = Task(rawValue: rawTask) else {
287224
print("Received unknown task \(rawTask)")
288-
exit(0)
225+
throw TaskError.code(1)
289226
}
290227

291-
let platforms = rawPlatforms.map { rawPlatform -> Platform in
228+
let platforms = try rawPlatforms.map { rawPlatform -> Platform in
292229
guard let platform = Platform(rawValue: rawPlatform) else {
293230
print("Received unknown platform type \(rawPlatform)")
294-
exit(0)
231+
throw TaskError.code(1)
295232
}
296233

297234
return platform
@@ -315,7 +252,7 @@ for platform in platforms {
315252
deletedXcodeproj = true
316253
} catch {
317254
print("Could not delete Valet.xcodeproj due to error: \(error)")
318-
exit(0)
255+
throw TaskError.code(1)
319256
}
320257
}
321258

@@ -349,11 +286,7 @@ for platform in platforms {
349286
xcodeBuildArguments.append("test")
350287
}
351288

352-
do {
353-
try execute(commandPath: "/usr/bin/xcodebuild", arguments: xcodeBuildArguments)
354-
} catch {
355-
print("xcodebuild failed with error: \(error)")
356-
}
289+
try execute(commandPath: "/usr/bin/xcodebuild", arguments: xcodeBuildArguments)
357290

358291
if deletedXcodeproj {
359292
do {

0 commit comments

Comments
 (0)