-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (157 loc) · 6.73 KB
/
xcodebuild.yml
File metadata and controls
193 lines (157 loc) · 6.73 KB
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
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'
- 'LICENSE'
- 'Package.swift'
- 'README.md'
- 'Tests/**'
- 'ProtocolProxy.podspec'
jobs:
ios:
name: iOS
runs-on: macOS-11
env:
LOGSDIR: /tmp/.protocolproxy.xcodebuild/iOS/Logs
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build iOS
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy" -destination "generic/platform=iOS" -configuration Debug SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-ios.log"
- name: Build iOS Simulator
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy" -destination "generic/platform=iOS Simulator" -configuration Debug 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 "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-ios.log"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: iOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log
maccatalyst:
name: Mac Catalyst
runs-on: macOS-11
env:
LOGSDIR: /tmp/.protocolproxy.xcodebuild/macCatalyst/Logs
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-maccatalyst.log"
- name: Test
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-maccatalyst.log"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: MacCatalystBuildLogs
path: ${{ env.LOGSDIR }}/*.log
macos:
name: macOS
runs-on: macOS-11
env:
LOGSDIR: /tmp/.protocolproxy.xcodebuild/macOS/Logs
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy macOS" -destination "generic/platform=macOS" -configuration Debug SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-macos.log"
- name: Test
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy macOS" -testPlan "ProtocolProxy macOS Tests" -configuration Debug SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-macos.log"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: macOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log
tvos:
name: tvOS
runs-on: macOS-11
env:
LOGSDIR: /tmp/.protocolproxy.xcodebuild/tvOS/Logs
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build tvOS
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS" -configuration Debug SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-tvos.log"
- name: Build tvOS Simulator
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug 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 "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy tvOS" -testPlan "ProtocolProxy tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-tvos.log"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: tvOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log
watchos:
name: watchOS
runs-on: macOS-11
env:
LOGSDIR: /tmp/.protocolproxy.xcodebuild/watchOS/Logs
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build watchOS
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS" -configuration Debug SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-watchos.log"
- name: Build watchOS Simulator
run: |
xcodebuild -project "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug 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 "ProtocolProxy.xcodeproj" -scheme "ProtocolProxy watchOS" -testPlan "ProtocolProxy watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-watchos.log"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: watchOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log