Skip to content

Commit

Permalink
Merge pull request #206 from keenlabs/update_travis
Browse files Browse the repository at this point in the history
Update Travis to use latest Xcode image, latest iOS version, and speed up build
  • Loading branch information
baumatron committed May 16, 2017
2 parents 6ddc34a + ab9d6c1 commit 820ec21
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .slather.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
coverage_service: coveralls
workspace: ./KeenClient.xcworkspace
xcodeproj: ./KeenClient.xcodeproj
scheme: KeenClient
ignore:
- KeenClientTests/*
- Library/*
Expand Down
56 changes: 45 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,49 @@
language: objective-c

cache: bundler
osx_image: xcode8.2
xcode_project: KeenClient.xcodeproj
xcode_scheme: KeenClient
xcode_sdk: iphonesimulator9.2

osx_image: xcode8.3

xcode_workspace: KeenClient.xcworkspace
xcode_scheme:
- KeenClientFramework
- KeenSwiftClientExample
- KeenClientExample
xcode_sdk: iphonesimulator10.3
env:
- XCODEBUILD_PLATFORM='iOS Simulator' XCODEBUILD_SIM_OS=10.3 XCODEBUILD_DEVICE='iPhone 6' XCODEBUILD_ACTION=build

matrix:
include:
- xcode_scheme: KeenClient
xcode_sdk: iphonesimulator10.3
env:
- XCODEBUILD_PLATFORM='iOS Simulator' XCODEBUILD_SIM_OS=10.3 XCODEBUILD_DEVICE='iPhone 6' XCODEBUILD_ACTION=test
- xcode_scheme: KeenClient
xcode_sdk: iphonesimulator10.3
env:
- XCODEBUILD_PLATFORM='iOS Simulator' XCODEBUILD_SIM_OS=9.3 XCODEBUILD_DEVICE='iPhone 6' XCODEBUILD_ACTION=test
- xcode_scheme: KeenClient
xcode_sdk: iphonesimulator10.3
env:
- XCODEBUILD_PLATFORM='iOS Simulator' XCODEBUILD_SIM_OS=8.4 XCODEBUILD_DEVICE='iPhone 6' XCODEBUILD_ACTION=test
- xcode_scheme: KeenClient-Cocoa
xcode_sdk: macosx10.12
env:
- XCODEBUILD_PLATFORM='OS X' XCODEBUILD_ACTION=build

before_install:
- gem install bundler
- rvm use 2.2.1 --install
- brew update
- brew outdated xctool || brew upgrade xctool
after_success:
- bundle exec slather coverage -s --scheme KeenClient KeenClient.xcodeproj
- bundle exec slather
script: ./bin/test.sh
- rvm use 2.3.0

script: ./bin/test.sh

after_success: |
case "$XCODEBUILD_ACTION" in
test)
bundle exec slather
;;
*)
echo "Not slathering."
;;
esac
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source 'https://rubygems.org'
#ruby='2.2.1'
ruby '2.2.1'
ruby '2.3.0'

gem 'slather'
gem 'xcpretty'
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1296396219C10AD200B2B653"
BuildableName = "libKeenClient-Cocoa.a"
BlueprintName = "KeenClient-Cocoa"
ReferencedContainer = "container:KeenClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1296396219C10AD200B2B653"
BuildableName = "libKeenClient-Cocoa.a"
BlueprintName = "KeenClient-Cocoa"
ReferencedContainer = "container:KeenClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1296396219C10AD200B2B653"
BuildableName = "libKeenClient-Cocoa.a"
BlueprintName = "KeenClient-Cocoa"
ReferencedContainer = "container:KeenClient.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
36 changes: 36 additions & 0 deletions bin/simulate_travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash --login

SCRIPTPATH=$(dirname $0)

# Do a travis-like validation build and test

gem install bundler
rvm use 2.3.0

export TRAVIS_XCODE_WORKSPACE="$SCRIPTPATH/../KeenClient.xcworkspace"
export TRAVIS_XCODE_SDK=iphonesimulator10.3
export XCODEBUILD_PLATFORM='iOS Simulator'
export XCODEBUILD_SIM_OS=10.3
export XCODEBUILD_DEVICE='iPhone 6'
export XCODEBUILD_ACTION=build

BUILD_SCRIPT="$SCRIPTPATH/test.sh"

export TRAVIS_XCODE_SCHEME=KeenClientFramework
$BUILD_SCRIPT

export TRAVIS_XCODE_SCHEME=KeenSwiftClientExample
$BUILD_SCRIPT

export TRAVIS_XCODE_SCHEME=KeenClientExample
$BUILD_SCRIPT

export TRAVIS_XCODE_SCHEME=KeenClient
export XCODEBUILD_ACTION=test
$BUILD_SCRIPT

export TRAVIS_XCODE_SCHEME=KeenClient-Cocoa
export TRAVIS_XCODE_SDK='macosx10.12'
export XCODEBUILD_PLATFORM='OS X'
export XCODEBUILD_ACTION=build
$BUILD_SCRIPT
37 changes: 12 additions & 25 deletions bin/test.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
#!/bin/sh
set -e -o pipefail

xcodebuild \
-scheme KeenSwiftClientExample \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=9.2' \
ONLY_ACTIVE_ARCH=NO \
clean build | bundle exec xcpretty --color

xcodebuild \
-scheme KeenClientExample \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=9.2' \
ONLY_ACTIVE_ARCH=NO \
clean build | bundle exec xcpretty --color

xcodebuild \
-scheme KeenClientFramework \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=9.2' \
ONLY_ACTIVE_ARCH=NO \
clean build | bundle exec xcpretty --color
if [[ "$XCODEBUILD_PLATFORM" == "iOS Simulator" ]]; then
# iOS build
XCODEBUILD_DESTINATION="platform=$XCODEBUILD_PLATFORM,OS=$XCODEBUILD_SIM_OS,name=$XCODEBUILD_DEVICE"
else
# OS X build
XCODEBUILD_DESTINATION="platform=$XCODEBUILD_PLATFORM"
fi

xcodebuild \
-scheme KeenClient \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 6,OS=9.2' \
ONLY_ACTIVE_ARCH=NO \
clean test | bundle exec xcpretty --color
-workspace $TRAVIS_XCODE_WORKSPACE \
-scheme $TRAVIS_XCODE_SCHEME \
-sdk $TRAVIS_XCODE_SDK \
-destination "$XCODEBUILD_DESTINATION" \
ONLY_ACTIVE_ARCH=NO clean $XCODEBUILD_ACTION | bundle exec xcpretty --color

0 comments on commit 820ec21

Please sign in to comment.