Skip to content

Commit bfcb48d

Browse files
committed
Construct CI build matrix from platform & OS X image
The new build matrix should have 10 items: 2 Xcodes * 5 platforms (Mac, iOS, tvOS, watchOS, CocoaPods).
1 parent 1f4497b commit bfcb48d

File tree

2 files changed

+59
-12
lines changed

2 files changed

+59
-12
lines changed

.travis.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,25 @@ language: objective-c
22
matrix:
33
include:
44
- osx_image: xcode7.3
5-
env:
6-
- XCODEBUILD_TEST_ACTION="test"
5+
env: PLATFORM=Mac
6+
- osx_image: xcode7.3
7+
env: PLATFORM=iOS
8+
- osx_image: xcode7.3
9+
env: PLATFORM=tvOS
10+
- osx_image: xcode7.3
11+
env: PLATFORM=watchOS
12+
- osx_image: xcode7.3
13+
env: PLATFORM=CocoaPods
14+
- osx_image: xcode8
15+
env: PLATFORM=Mac TEST_ACTION="build-for-testing test-without-building"
16+
- osx_image: xcode8
17+
env: PLATFORM=iOS TEST_ACTION="build-for-testing test-without-building"
18+
- osx_image: xcode8
19+
env: PLATFORM=tvOS TEST_ACTION="build-for-testing test-without-building"
20+
- osx_image: xcode8
21+
env: PLATFORM=watchOS TEST_ACTION="build-for-testing test-without-building"
722
- osx_image: xcode8
8-
env:
9-
- XCODEBUILD_TEST_ACTION="build-for-testing test-without-building"
23+
env: PLATFORM=CocoaPods
1024

1125
env:
1226
global:
@@ -15,14 +29,7 @@ env:
1529
git:
1630
submodules: false
1731

18-
script:
19-
- set -o pipefail
20-
- carthage bootstrap --no-use-binaries
21-
- xcodebuild $XCODEBUILD_TEST_ACTION -scheme Rex-Mac | xcpretty -c
22-
- xcodebuild $XCODEBUILD_TEST_ACTION -scheme Rex-iOS -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 6s" | xcpretty -c
23-
- xcodebuild $XCODEBUILD_TEST_ACTION -scheme Rex-tvOS -sdk appletvsimulator -destination "platform=tvOS Simulator,name=Apple TV 1080p" | xcpretty -c
24-
- xcodebuild build -scheme Rex-watchOS -sdk watchsimulator -destination "platform=watchOS Simulator,name=Apple Watch - 38mm" | xcpretty -c
25-
- pod lib lint --quick --allow-warnings
32+
script: script/ci "$PLATFORM"
2633

2734
notifications:
2835
email: false

script/ci

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
3+
set -e -o pipefail
4+
5+
bootstrap() {
6+
case "$1" in
7+
CocoaPods)
8+
;;
9+
*)
10+
carthage bootstrap --no-use-binaries --platform "$1"
11+
;;
12+
esac
13+
}
14+
15+
build() {
16+
case "$1" in
17+
Mac)
18+
xcodebuild ${TEST_ACTION:-test} -scheme Rex-Mac | xcpretty -c
19+
;;
20+
iOS)
21+
xcodebuild ${TEST_ACTION:-test} -scheme Rex-iOS -destination "platform=iOS Simulator,name=iPhone 6s" | xcpretty -c
22+
;;
23+
tvOS)
24+
xcodebuild ${TEST_ACTION:-test} -scheme Rex-tvOS -destination "platform=tvOS Simulator,name=Apple TV 1080p" | xcpretty -c
25+
;;
26+
watchOS)
27+
xcodebuild build -scheme Rex-watchOS -destination "platform=watchOS Simulator,name=Apple Watch - 42mm" | xcpretty -c
28+
;;
29+
CocoaPods)
30+
pod lib lint --quick --allow-warnings
31+
;;
32+
*)
33+
echo 2>&1 "Usage: $0 <Mac|iOS|tvOS|watchOS|CocoaPods>"
34+
exit 1
35+
;;
36+
esac
37+
}
38+
39+
bootstrap "$@"
40+
build "$@"

0 commit comments

Comments
 (0)