Skip to content

Commit a363672

Browse files
authored
Add Xcode 10 travis testing (#1932)
1 parent 3a72090 commit a363672

File tree

3 files changed

+52
-8
lines changed

3 files changed

+52
-8
lines changed

.travis.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: osx
2-
osx_image: xcode9.4
2+
osx_image: xcode10
33
language: objective-c
44
cache:
55
- bundler
@@ -33,8 +33,6 @@ jobs:
3333
env:
3434
- PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
3535
before_install:
36-
- npm install ios-sim -g
37-
- ios-sim start --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus, 11.3"
3836
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
3937
script:
4038
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
@@ -116,6 +114,36 @@ jobs:
116114

117115
# Alternative platforms
118116

117+
# Xcode 9
118+
- stage: test
119+
osx_image: xcode9.4
120+
env:
121+
- PROJECT=Firebase PLATFORM=iOS METHOD=xcodebuild
122+
before_install:
123+
- npm install ios-sim -g
124+
- ios-sim start --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus, 11.3"
125+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
126+
script:
127+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
128+
129+
- stage: test
130+
osx_image: xcode9.4
131+
env:
132+
- PROJECT=InAppMessagingDisplay PLATFORM=iOS METHOD=xcodebuild
133+
before_install:
134+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
135+
script:
136+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
137+
138+
- stage: test
139+
osx_image: xcode9.4
140+
env:
141+
- PROJECT=Firestore PLATFORM=iOS METHOD=xcodebuild
142+
before_install:
143+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
144+
script:
145+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM $METHOD
146+
119147
- stage: test
120148
env:
121149
- PROJECT=Firestore PLATFORM=macOS METHOD=cmake

scripts/build.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,25 +231,41 @@ case "$product-$method-$platform" in
231231
;;
232232

233233
InAppMessagingDisplay-xcodebuild-iOS)
234-
# Run UI tests on both iPad and iphone simultors
234+
# Run UI tests on both iPad and iPhone simulators
235+
# TODO: Running two destinations from one xcodebuild command stopped working with Xcode 10.
236+
# Consider separating static library tests to a separate job.
235237
RunXcodebuild \
236238
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
237239
-scheme 'FiamDisplaySwiftExample' \
238240
"${xcb_flags[@]}" \
239-
-destination 'platform=iOS Simulator,name=iPad Air' \
241+
build \
242+
test
243+
244+
RunXcodebuild \
245+
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
246+
-scheme 'FiamDisplaySwiftExample' \
247+
-sdk 'iphonesimulator' \
248+
-destination 'platform=iOS Simulator,name=iPad Pro (9.7-inch)' \
240249
build \
241250
test
242251

243252
cd InAppMessagingDisplay/Example
244253
sed -i -e 's/use_frameworks/\#use_frameworks/' Podfile
245254
pod update --no-repo-update
246255
cd ../..
247-
# Run UI tests on both iPad and iphone simultors
256+
# Run UI tests on both iPad and iPhone simulators
248257
RunXcodebuild \
249258
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
250259
-scheme 'FiamDisplaySwiftExample' \
251260
"${xcb_flags[@]}" \
252-
-destination 'platform=iOS Simulator,name=iPad Air' \
261+
build \
262+
test
263+
264+
RunXcodebuild \
265+
-workspace 'InAppMessagingDisplay/Example/InAppMessagingDisplay-Sample.xcworkspace' \
266+
-scheme 'FiamDisplaySwiftExample' \
267+
-sdk 'iphonesimulator' \
268+
-destination 'platform=iOS Simulator,name=iPad Pro (9.7-inch)' \
253269
build \
254270
test
255271
;;

scripts/style.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if [[ "$system" == "Darwin" ]]; then
6161
version="${version/*version /}"
6262
# Allow an older swiftformat because travis isn't running High Sierra yet
6363
# and the formula hasn't been updated in a while on Sierra :-/.
64-
if [[ "$version" != "0.32.0" && "$version" != "0.33"* ]]; then
64+
if [[ "$version" != "0.32.0" && "$version" != "0.33"* && "$version" != "0.35"* ]]; then
6565
echo "Version $version installed. Please upgrade to at least swiftformat 0.33.8"
6666
echo "If it's installed via homebrew you can run: brew upgrade swiftformat"
6767
exit 1

0 commit comments

Comments
 (0)