Skip to content

Commit

Permalink
Update Travis CI build matrix
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Rachel Brindle and Tim Jarratt authored and tjarratt committed Feb 3, 2016
1 parent 3d0d8e3 commit 666f905
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
language: objective-c
osx_image: xcode7.2

env:
matrix:
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="7.0.3" TASK="rake ci"
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="7.1" TASK="rake ci"
- CEDAR_SDK_VERSION="8.1" CEDAR_SDK_RUNTIME_VERSION="8.1" TASK="rake ci"
matrix:
include:
- env: CEDAR_SDK_VERSION="9.2" CEDAR_SDK_RUNTIME_VERSION="8.4" TASK="rake ci"
- env: CEDAR_SDK_VERSION="9.2" CEDAR_SDK_RUNTIME_VERSION="9.2" TASK="rake ci"

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

- TASK="./install.sh"
- TASK="./installCodeSnippetsAndTemplates"
- env: TASK="./install.sh"
- env: TASK="./installCodeSnippetsAndTemplates"

before_install: brew update
install:
- bundle install
- brew install ios-sim
- ios-sim showsdks
- ios-sim showdevicetypes

script:
# run a printer task to keep travis from terminating static analysis
Expand Down
1 change: 1 addition & 0 deletions scripts/rake/helpers/simulator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ def self.kill
system %Q[killall -m -KILL "gdb" > /dev/null 2>&1]
system %Q[killall -m -KILL "otest" > /dev/null 2>&1]
system %Q[killall -m -KILL "iPhone Simulator" > /dev/null 2>&1]
system %Q[killall -m -KILL "Simulator" > /dev/null 2>&1]
end
end
15 changes: 11 additions & 4 deletions scripts/rake/helpers/xcode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def self.developer_dir
`xcode-select -print-path`.strip
end

def self.build_dir(effective_platform_name = "")
File.join(BUILD_DIR, CONFIGURATION + effective_platform_name)
def self.build_dir(effective_platform_name = "", configuration = CONFIGURATION)
File.join(BUILD_DIR, configuration + effective_platform_name)
end

def self.sdk_dir_for_version(version)
Expand All @@ -19,8 +19,12 @@ def self.sdk_dir_for_version(version)
path
end

def self.iPhone_simulator_name
'iPhone 5s'
end

def self.destination_for_ios_sdk(version)
"name=iPhone 5s,OS=#{version}"
"name=#{iPhone_simulator_name},OS=#{version}"
end

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

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

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

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`))

Shell.fold "test.#{options[:scheme] || options[:target]}" do
Shell.run(%Q(xcodebuild -project #{PROJECT_NAME}.xcodeproj -configuration #{CONFIGURATION} -derivedDataPath #{DERIVED_DATA_DIR.inspect} SYMROOT=#{BUILD_DIR.inspect} clean build test #{args}), logfile)
end
Expand Down
12 changes: 8 additions & 4 deletions scripts/rake/tasks/spec_suites.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

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

desc "Run UI specs"
Expand All @@ -52,7 +52,7 @@
}

Shell.with_env(env_vars) do
Simulator.launch(Xcode.build_dir("-iphonesimulator"), UI_SPECS_TARGET_NAME, Xcode.build_dir("-uispecs.run.log"))
Simulator.launch(Xcode.build_dir("-iphonesimulator", "Debug"), UI_SPECS_TARGET_NAME, Xcode.build_dir("-uispecs.run.log"))
end
end
end
Expand Down Expand Up @@ -123,7 +123,11 @@

desc "Build iOS dynamic framework specs"
task :build do
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")
Xcode.build(target: IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME,
sdk: "iphonesimulator#{SDK_VERSION}",
args: 'ARCHS=i386 '+Xcode.swift_build_settings,
configuration: "Debug",
logfile: "frameworks.ios.dynamic.specs.build.log")
end

desc "Runs iOS dynamic framework specs"
Expand All @@ -134,7 +138,7 @@
}

Shell.with_env(env_vars) do
Simulator.launch(Xcode.build_dir("-iphonesimulator"), IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, Xcode.build_dir("-frameworks.ios.dynamic.specs.run.log"))
Simulator.launch(Xcode.build_dir("-iphonesimulator", "Debug"), IOS_DYNAMIC_FRAMEWORK_SPECS_TARGET_NAME, Xcode.build_dir("-frameworks.ios.dynamic.specs.run.log"))
end
end
end
Expand Down

0 comments on commit 666f905

Please sign in to comment.