Skip to content

Commit 3ce08c7

Browse files
author
Rachel Brindle and Tim Jarratt
committed
Update Travis CI build matrix
- Drop iOS 7 runtime - Use Xcode 7 for testing the iOS 8.4 and 9.2 runtimes - Only build against latest iOS 9 SDK available in the Xcode 7.2 image - Run the UI specs with the Debug configuration so symbolication works properly - Try to ensure the simulator has run at least once before we run tests. Under Xcode 7 we need to wait for the asynchronous process of "launching" the simulator. - Try more aggressively to kill the simulator in-between runs. The simulator process was renamed sometime in the Xcode 7 release timeframe, and it may only be called "Simulator" now. I anticipate that we may need to do more work in order to wait for the simulator to "boot" initially, which was also added in the Xcode 7 release.
1 parent 3d0d8e3 commit 3ce08c7

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

.travis.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
language: objective-c
2+
osx_image: xcode7.2
23

3-
env:
4-
matrix:
5-
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="7.0.3" TASK="rake ci"
6-
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="7.1" TASK="rake ci"
7-
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="8.1" TASK="rake ci"
4+
matrix:
5+
include:
6+
- env: CEDAR_SDK_VERSION="9.2" CEDAR_SDK_RUNTIME_VERSION="8.4" TASK="rake ci"
7+
- env: CEDAR_SDK_VERSION="9.2" CEDAR_SDK_RUNTIME_VERSION="9.2" TASK="rake ci"
88

9-
# Analyze takes too long -- vary on runtime SDK
10-
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="8.1" TASK="rake suites:specs:analyze"
11-
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="8.1" TASK="rake suites:uispecs:analyze"
12-
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="8.1" TASK="rake suites:focused_specs:analyze"
9+
# Analyze takes too long to vary on runtime SDK. Latest is fine.
10+
- env: CEDAR_SDK_VERSION="9.2" TASK="rake suites:specs:analyze"
11+
- env: CEDAR_SDK_VERSION="9.2" TASK="rake suites:uispecs:analyze"
12+
- env: CEDAR_SDK_VERSION="9.2" TASK="rake suites:focused_specs:analyze"
1313

14-
- TASK="./install.sh"
15-
- TASK="./installCodeSnippetsAndTemplates"
14+
- env: TASK="./install.sh"
15+
- env: TASK="./installCodeSnippetsAndTemplates"
1616

1717
before_install: brew update
1818
install:
1919
- bundle install
2020
- brew install ios-sim
21+
- ios-sim showsdks
22+
- ios-sim showdevicetypes
2123

2224
script:
2325
# run a printer task to keep travis from terminating static analysis

scripts/rake/helpers/simulator.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ def self.kill
3737
system %Q[killall -m -KILL "gdb" > /dev/null 2>&1]
3838
system %Q[killall -m -KILL "otest" > /dev/null 2>&1]
3939
system %Q[killall -m -KILL "iPhone Simulator" > /dev/null 2>&1]
40+
system %Q[killall -m -KILL "Simulator" > /dev/null 2>&1]
4041
end
4142
end

scripts/rake/helpers/xcode.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def self.developer_dir
99
`xcode-select -print-path`.strip
1010
end
1111

12-
def self.build_dir(effective_platform_name = "")
13-
File.join(BUILD_DIR, CONFIGURATION + effective_platform_name)
12+
def self.build_dir(effective_platform_name = "", configuration = CONFIGURATION)
13+
File.join(BUILD_DIR, configuration + effective_platform_name)
1414
end
1515

1616
def self.sdk_dir_for_version(version)
@@ -19,8 +19,12 @@ def self.sdk_dir_for_version(version)
1919
path
2020
end
2121

22+
def self.iPhone_simulator_name
23+
'iPhone 5s'
24+
end
25+
2226
def self.destination_for_ios_sdk(version)
23-
"name=iPhone 5s,OS=#{version}"
27+
"name=#{iPhone_simulator_name},OS=#{version}"
2428
end
2529

2630
def self.swift_build_settings
@@ -41,9 +45,10 @@ def self.build(options = nil)
4145
args += " -target #{options[:target].inspect}" if options[:target]
4246
args += " -sdk #{options[:sdk].inspect}" if options[:sdk]
4347
args += " -scheme #{options[:scheme].inspect}" if options[:scheme]
48+
args += " -configuration #{options[:configuration] || CONFIGURATION}"
4449

4550
Shell.fold "build.#{options[:scheme] || options[:target]}" do
46-
Shell.run(%Q(xcodebuild -project #{PROJECT_NAME}.xcodeproj -configuration #{CONFIGURATION} SYMROOT=#{BUILD_DIR.inspect} clean build #{args}), logfile)
51+
Shell.run(%Q(xcodebuild -project #{PROJECT_NAME}.xcodeproj SYMROOT=#{BUILD_DIR.inspect} clean build #{args}), logfile)
4752
end
4853
end
4954

@@ -57,6 +62,9 @@ def self.test(options = nil)
5762
args += " -sdk #{options[:sdk].inspect}" if options[:sdk]
5863
args += " -scheme #{options[:scheme].inspect}" if options[:scheme]
5964

65+
Shell.run(%Q(open -b com.apple.iphonesimulator --args -CurrentDeviceUDID `xcrun instruments -s | grep -o "#{iPhone_simulator_name} (#{SDK_VERSION}) \[.*\]" |grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$/\1/" 2>/dev/null`))
66+
Shell.run("sleep 5") # need to wait for the simulator to be done "launching"
67+
6068
Shell.fold "test.#{options[:scheme] || options[:target]}" do
6169
Shell.run(%Q(xcodebuild -project #{PROJECT_NAME}.xcodeproj -configuration #{CONFIGURATION} -derivedDataPath #{DERIVED_DATA_DIR.inspect} SYMROOT=#{BUILD_DIR.inspect} clean build test #{args}), logfile)
6270
end

scripts/rake/tasks/spec_suites.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
desc "Build UI specs"
4343
task :build do
44-
Xcode.build(target: UI_SPECS_TARGET_NAME, sdk: "iphonesimulator#{SDK_VERSION}", args: 'ARCHS=i386', logfile: "uispecs.build.log")
44+
Xcode.build(target: UI_SPECS_TARGET_NAME, sdk: "iphonesimulator#{SDK_VERSION}", args: 'ARCHS=i386', configuration: "Debug", logfile: "uispecs.build.log")
4545
end
4646

4747
desc "Run UI specs"
@@ -52,7 +52,7 @@
5252
}
5353

5454
Shell.with_env(env_vars) do
55-
Simulator.launch(Xcode.build_dir("-iphonesimulator"), UI_SPECS_TARGET_NAME, Xcode.build_dir("-uispecs.run.log"))
55+
Simulator.launch(Xcode.build_dir("-iphonesimulator", "Debug"), UI_SPECS_TARGET_NAME, Xcode.build_dir("-uispecs.run.log"))
5656
end
5757
end
5858
end
@@ -123,7 +123,11 @@
123123

124124
desc "Build iOS dynamic framework specs"
125125
task :build do
126-
Xcode.build(target: IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, sdk: "iphonesimulator#{SDK_VERSION}", args: 'ARCHS=i386 '+Xcode.swift_build_settings, logfile: "frameworks.ios.dynamic.specs.build.log")
126+
Xcode.build(target: IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME,
127+
sdk: "iphonesimulator#{SDK_VERSION}",
128+
args: 'ARCHS=i386 '+Xcode.swift_build_settings,
129+
configuration: "Debug",
130+
logfile: "frameworks.ios.dynamic.specs.build.log")
127131
end
128132

129133
desc "Runs iOS dynamic framework specs"
@@ -134,7 +138,7 @@
134138
}
135139

136140
Shell.with_env(env_vars) do
137-
Simulator.launch(Xcode.build_dir("-iphonesimulator"), IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, Xcode.build_dir("-frameworks.ios.dynamic.specs.run.log"))
141+
Simulator.launch(Xcode.build_dir("-iphonesimulator", "Debug"), IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, Xcode.build_dir("-frameworks.ios.dynamic.specs.run.log"))
138142
end
139143
end
140144
end

0 commit comments

Comments
 (0)