11name : Xcode Project
2- on : push
2+ on : [ push, workflow_dispatch]
33
44jobs :
55 ios :
@@ -12,15 +12,20 @@ jobs:
1212
1313 - name : Build iOS
1414 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
1616
1717 - name : Build iOS Simulator
1818 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
2020
2121 - name : Test
2222 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
2429
2530 maccatalyst :
2631 name : Mac Catalyst
@@ -32,11 +37,11 @@ jobs:
3237
3338 - name : Build
3439 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
3641
3742 - name : Test
3843 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
4045
4146 macos :
4247 name : macOS
@@ -48,11 +53,11 @@ jobs:
4853
4954 - name : Build
5055 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
5257
5358 - name : Test
5459 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
5661
5762 tvos :
5863 name : tvOS
@@ -64,28 +69,42 @@ jobs:
6469
6570 - name : Build tvOS
6671 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
6873
6974 - name : Build tvOS Simulator
7075 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
7277
7378 - name : Test
7479 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
7686
7787 watchos :
7888 name : watchOS
79- runs-on : macOS-latest
89+ runs-on : macOS-11
8090
8191 steps :
8292 - name : Checkout Code
8393 uses : actions/checkout@v2
8494
8595 - name : Build watchOS
8696 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
8898
8999 - name : Build watchOS Simulator
90100 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