-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (84 loc) · 4.43 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
name: Xcode Project
on: [push, workflow_dispatch]
jobs:
ios:
name: iOS
runs-on: macOS-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Build iOS
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -destination "generic/platform=iOS" -configuration Debug
- name: Build iOS Simulator
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -destination "generic/platform=iOS Simulator" -configuration Debug
- 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 MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -testPlan "MethodNotificationCenterTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
maccatalyst:
name: Mac Catalyst
runs-on: macOS-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Build
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug
- name: Test
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter" -testPlan "MethodNotificationCenterTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test
macos:
name: macOS
runs-on: macOS-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Build
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter macOS" -destination "generic/platform=macOS" -configuration Debug
- name: Test
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter macOS" -testPlan "MethodNotificationCenter macOS Tests" -configuration Debug ONLY_ACTIVE_ARCH=YES test
tvos:
name: tvOS
runs-on: macOS-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Build tvOS
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter tvOS" -destination "generic/platform=tvOS" -configuration Debug
- name: Build tvOS Simulator
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug
- 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 MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter tvOS" -testPlan "MethodNotificationCenter tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test
watchos:
name: watchOS
runs-on: macOS-11
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Build watchOS
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter watchOS" -destination "generic/platform=watchOS" -configuration Debug
- name: Build watchOS Simulator
run: |
xcodebuild -project MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug
- 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 MethodNotificationCenter.xcodeproj -scheme "MethodNotificationCenter watchOS" -testPlan "MethodNotificationCenter watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test