[Travis CI] Build Optimizations (#1743)

* [Travis CI] Build Optimizations

* update cocoapods versionm

* test sharing derived data directories

* Hack to reduce travis run time

* Remove test file

* Add missing slashes
This commit is contained in:
Hannah Troisi
2016-06-21 01:02:40 -07:00
committed by appleguy
parent 92b412b73f
commit 21d0f1e10d
2 changed files with 92 additions and 6 deletions

View File

@@ -1,4 +1,7 @@
language: objective-c
cache:
- bundler
- cocoapods
osx_image: xcode7.3
git:
depth: 10
@@ -6,7 +9,7 @@ before_install:
- brew update
- brew outdated xctool || brew upgrade xctool
- brew outdated carthage || brew upgrade carthage
- gem install cocoapods -v 0.38.2
- gem install cocoapods -v 1.0.1
- gem install xcpretty
- gem install xcpretty-travis-formatter
# - gem install slather
@@ -14,7 +17,9 @@ before_install:
install: echo "<3"
env:
- MODE=tests
- MODE=examples
- MODE=examples-pt1
- MODE=examples-pt2
- MODE=examples-pt3
- MODE=life-without-cocoapods
- MODE=framework
script: ./build.sh $MODE

View File

@@ -36,21 +36,102 @@ if [ "$MODE" = "tests" ]; then
exit 0
fi
if [ "$MODE" = "examples" ]; then
if [ "$MODE" = "examples-pt1" ]; then
echo "Verifying that all AsyncDisplayKit examples compile."
for example in examples/*/; do
echo "Building $example."
for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -6 | head); do
echo "Building (examples-pt1) $example."
if [ -f "${example}/Podfile" ]; then
echo "Using CocoaPods"
pod install --project-directory=$example
set -o pipefail && xcodebuild \
-workspace "${example}Sample.xcworkspace" \
-workspace "${example}/Sample.xcworkspace" \
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
-derivedDataPath ~/ \
build | xcpretty $FORMATTER
elif [ -f "${example}/Cartfile" ]; then
echo "Using Carthage"
local_repo=`pwd`
current_branch=`git rev-parse --abbrev-ref HEAD`
cd $example
echo "git \"file://${local_repo}\" \"${current_branch}\"" > "Cartfile"
carthage update --platform iOS
set -o pipefail && xcodebuild \
-project "Sample.xcodeproj" \
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
build | xcpretty $FORMATTER
cd ../..
fi
done
trap - EXIT
exit 0
fi
if [ "$MODE" = "examples-pt2" ]; then
echo "Verifying that all AsyncDisplayKit examples compile."
for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -12 | tail -6 | head); do
echo "Building $example (examples-pt2)."
if [ -f "${example}/Podfile" ]; then
echo "Using CocoaPods"
pod install --project-directory=$example
set -o pipefail && xcodebuild \
-workspace "${example}/Sample.xcworkspace" \
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
-derivedDataPath ~/ \
build | xcpretty $FORMATTER
elif [ -f "${example}/Cartfile" ]; then
echo "Using Carthage"
local_repo=`pwd`
current_branch=`git rev-parse --abbrev-ref HEAD`
cd $example
echo "git \"file://${local_repo}\" \"${current_branch}\"" > "Cartfile"
carthage update --platform iOS
set -o pipefail && xcodebuild \
-project "Sample.xcodeproj" \
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
build | xcpretty $FORMATTER
cd ../..
fi
done
trap - EXIT
exit 0
fi
if [ "$MODE" = "examples-pt3" ]; then
echo "Verifying that all AsyncDisplayKit examples compile."
for example in $((find ./examples -type d -maxdepth 1 \( ! -iname ".*" \)) | head -7 | head); do
echo "Building $example (examples-pt3)."
if [ -f "${example}/Podfile" ]; then
echo "Using CocoaPods"
pod install --project-directory=$example
set -o pipefail && xcodebuild \
-workspace "${example}/Sample.xcworkspace" \
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
-derivedDataPath ~/ \
build | xcpretty $FORMATTER
elif [ -f "${example}/Cartfile" ]; then
echo "Using Carthage"