Skip to content

Commit 8ccb2cb

Browse files
ci(travis): upload logs to s3 when build fails (#230)
* ci(travis): upload logs to s3 when build fails
1 parent 70f7b18 commit 8ccb2cb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ jobs:
5959
# preload simulator
6060
- Scripts/start_simulator.sh
6161
script:
62-
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then xcodebuild test -workspace OptimizelySDK.xcworkspace -scheme $SCHEME -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -sdk $TEST_SDK -destination "platform=$PLATFORM,OS=$OS,name=$NAME" ONLY_ACTIVE_ARCH=YES > buildoutput; fi
63-
- cat buildoutput | xcpretty
62+
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then xcodebuild test -workspace OptimizelySDK.xcworkspace -scheme $SCHEME -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -sdk $TEST_SDK -destination "platform=$PLATFORM,OS=$OS,name=$NAME" ONLY_ACTIVE_ARCH=YES > buildoutput; cat buildoutput | xcpretty; fi
6463
after_success:
6564
- slather
6665
- sleep 5 # https://github.com/travis-ci/travis-ci/issues/4725
66+
after_failure:
67+
# install travis artifacts uploader
68+
- sudo curl -sL https://raw.githubusercontent.com/travis-ci/artifacts/master/install | bash
69+
- artifacts upload --target-paths "/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/xcodebuild_logs" $(find /Users/travis/Library/Developer/Xcode/ -name *.xcresult -o -name *.log)
70+
- artifacts upload --target-paths "/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/buildoutput" "$TRAVIS_BUILD_DIR/buildoutput"
6771
- <<: *unittests
6872
env: SCHEME=OptimizelySwiftSDK-iOS TEST_SDK=iphonesimulator PLATFORM='iOS Simulator' OS=11.4 NAME='iPhone 7 Plus'
6973
name: PLATFORM='iOS Simulator' OS=11.4 NAME='iPhone 7 Plus'

0 commit comments

Comments
 (0)