1
1
name : Xcode Project
2
- on : push
2
+ on : [ push, workflow_dispatch]
3
3
4
4
jobs :
5
5
ios :
@@ -12,15 +12,20 @@ jobs:
12
12
13
13
- name : Build iOS
14
14
run : |
15
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphoneos -configuration Debug
15
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=iOS" -configuration Debug
16
16
17
17
- name : Build iOS Simulator
18
18
run : |
19
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk iphonesimulator -configuration Debug
19
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=iOS Simulator" -configuration Debug
20
20
21
21
- name : Test
22
22
run : |
23
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max" -configuration Debug ONLY_ACTIVE_ARCH=YES test
23
+ IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
24
+ if [ "${#IOS_SIM}" == "0" ]; then
25
+ IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
26
+ fi
27
+
28
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
24
29
25
30
maccatalyst :
26
31
name : Mac Catalyst
@@ -32,11 +37,11 @@ jobs:
32
37
33
38
- name : Build
34
39
run : |
35
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -sdk macosx -configuration Debug
40
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug
36
41
37
42
- name : Test
38
43
run : |
39
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -destination "platform=macOS" -configuration Debug ONLY_ACTIVE_ARCH=YES test
44
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy" -testPlan "ProtocolProxyTests" - destination "platform=macOS,variant=Mac Catalyst " -configuration Debug ONLY_ACTIVE_ARCH=YES test
40
45
41
46
macos :
42
47
name : macOS
@@ -48,11 +53,11 @@ jobs:
48
53
49
54
- name : Build
50
55
run : |
51
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug
56
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -destination "generic/platform=macOS" - configuration Debug
52
57
53
58
- name : Test
54
59
run : |
55
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -configuration Debug test
60
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy macOS" -testPlan "ProtocolProxy macOS Tests" - configuration Debug ONLY_ACTIVE_ARCH=YES test
56
61
57
62
tvos :
58
63
name : tvOS
@@ -64,28 +69,42 @@ jobs:
64
69
65
70
- name : Build tvOS
66
71
run : |
67
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvos -configuration Debug
72
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS" -configuration Debug
68
73
69
74
- name : Build tvOS Simulator
70
75
run : |
71
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -sdk appletvsimulator -configuration Debug
76
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug
72
77
73
78
- name : Test
74
79
run : |
75
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -destination "platform=tvOS Simulator,name=Apple TV 4K" -configuration Debug ONLY_ACTIVE_ARCH=YES test
80
+ TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
81
+ if [ "${#TVOS_SIM}" == "0" ]; then
82
+ TVOS_SIM = "Apple TV" # Fallback Simulator
83
+ fi
84
+
85
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy tvOS" -testPlan "ProtocolProxy tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
76
86
77
87
watchos :
78
88
name : watchOS
79
- runs-on : macOS-latest
89
+ runs-on : macOS-11
80
90
81
91
steps :
82
92
- name : Checkout Code
83
93
uses : actions/checkout@v2
84
94
85
95
- name : Build watchOS
86
96
run : |
87
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -sdk watchos -configuration Debug
97
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS" -configuration Debug
88
98
89
99
- name : Build watchOS Simulator
90
100
run : |
91
- xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -sdk watchsimulator -configuration Debug
101
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug
102
+
103
+ - name : Test
104
+ run : |
105
+ WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
106
+ if [ "${#WATCHOS_SIM}" == "0" ]; then
107
+ WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
108
+ fi
109
+
110
+ xcodebuild -project ProtocolProxy.xcodeproj -scheme "ProtocolProxy watchOS" -testPlan "ProtocolProxy watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
0 commit comments