-
Notifications
You must be signed in to change notification settings - Fork 3
244 lines (198 loc) · 7.86 KB
/
xcodebuild.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: Xcode Project
on:
workflow_dispatch:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- '.github/**' # Ignore all files under '.github'
- '!.github/workflows/xcodebuild.yml' # Except for this workflow
- '.gitignore'
- '.remarkrc'
- '.swiftlint.yml'
- 'codecov.yml'
- 'Documentation/**'
- 'LICENSE'
- 'Package.swift'
- 'README.md'
- 'Tests/**'
- 'Half.podspec'
jobs:
ios:
strategy:
matrix:
os: [macOS-13]
xcode: ['15.0']
name: iOS
runs-on: ${{ matrix.os }}
env:
LOGSDIR: /tmp/.half.xcodebuild/iOS/Logs
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build iOS
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -destination "generic/platform=iOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-ios.log"
- name: Build iOS Simulator
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -destination "generic/platform=iOS Simulator" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-iossimulator.log"
- name: Test
run: |
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#IOS_SIM}" == "0" ]; then
IOS_SIM="iPhone 12 Pro" # Fallback Simulator
fi
xcodebuild -project "Half.xcodeproj" -scheme "Half" -testPlan "HalfTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-ios.log"
- name: Upload Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: iOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log
maccatalyst:
strategy:
matrix:
os: [macOS-13]
xcode: ['15.0']
name: Mac Catalyst
runs-on: ${{ matrix.os }}
env:
LOGSDIR: /tmp/.half.xcodebuild/macCatalyst/Logs
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-maccatalyst.log"
- name: Test
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -testPlan "HalfTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-maccatalyst.log"
- name: Upload Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: MacCatalystBuildLogs
path: ${{ env.LOGSDIR }}/*.log
macos:
strategy:
matrix:
os: [macOS-13]
xcode: ['15.0']
name: macOS
runs-on: ${{ matrix.os }}
env:
LOGSDIR: /tmp/.half.xcodebuild/macOS/Logs
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half macOS" -destination "generic/platform=macOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-macos.log"
- name: Test
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half macOS" -testPlan "Half macOS Tests" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-macos.log"
- name: Upload Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: macOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log
tvos:
strategy:
matrix:
os: [macOS-13]
xcode: ['15.0']
name: tvOS
runs-on: ${{ matrix.os }}
env:
LOGSDIR: /tmp/.half.xcodebuild/tvOS/Logs
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build tvOS
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half tvOS" -destination "generic/platform=tvOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-tvos.log"
- name: Build tvOS Simulator
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-tvossimulator.log"
- name: Test
run: |
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#TVOS_SIM}" == "0" ]; then
TVOS_SIM="Apple TV" # Fallback Simulator
fi
xcodebuild -project "Half.xcodeproj" -scheme "Half tvOS" -testPlan "Half tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-tvos.log"
- name: Upload Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: tvOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log
watchos:
strategy:
matrix:
os: [macOS-13]
xcode: ['15.0']
name: watchOS
runs-on: ${{ matrix.os }}
env:
LOGSDIR: /tmp/.half.xcodebuild/watchOS/Logs
steps:
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build watchOS
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half watchOS" -destination "generic/platform=watchOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-watchos.log"
- name: Build watchOS Simulator
run: |
xcodebuild -project "Half.xcodeproj" -scheme "Half watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-watchossimulator.log"
- name: Test
run: |
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#WATCHOS_SIM}" == "0" ]; then
WATCHOS_SIM="Apple Watch Series 6 - 44mm" # Fallback Simulator
fi
xcodebuild -project "Half.xcodeproj" -scheme "Half watchOS" -testPlan "Half watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-watchos.log"
- name: Upload Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: watchOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log