diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/android/install.sh | 15 | ||||
-rwxr-xr-x | scripts/android/run.sh | 61 | ||||
-rwxr-xr-x | scripts/android/toolchain.sh | 26 | ||||
-rwxr-xr-x | scripts/android_env.sh | 25 | ||||
-rwxr-xr-x | scripts/flags.sh | 32 | ||||
-rwxr-xr-x | scripts/install_node.sh | 4 | ||||
-rwxr-xr-x | scripts/ios/install.sh | 13 | ||||
-rwxr-xr-x | scripts/ios/run.sh | 27 | ||||
-rwxr-xr-x | scripts/ios_travis/add-key.sh (renamed from scripts/ios/add-key.sh) | 8 | ||||
-rw-r--r-- | scripts/ios_travis/apple.crt (renamed from scripts/ios/apple.crt) | bin | 1063 -> 1063 bytes | |||
-rw-r--r-- | scripts/ios_travis/ios-dist.cer.enc (renamed from scripts/ios/ios-dist.cer.enc) | 0 | ||||
-rw-r--r-- | scripts/ios_travis/ios-dist.p12.enc (renamed from scripts/ios/ios-dist.p12.enc) | 0 | ||||
-rw-r--r-- | scripts/ios_travis/ios-in-house.mobileprovision.enc (renamed from scripts/ios/ios-in-house.mobileprovision.enc) | 0 | ||||
-rwxr-xr-x | scripts/ios_travis/remove-key.sh (renamed from scripts/ios/remove-key.sh) | 0 | ||||
-rwxr-xr-x | scripts/linux/install.sh | 22 | ||||
-rwxr-xr-x | scripts/linux/run.sh | 75 | ||||
-rwxr-xr-x | scripts/local_mason.sh | 5 | ||||
-rwxr-xr-x | scripts/npm_install.sh | 8 | ||||
-rwxr-xr-x | scripts/osx/install.sh | 13 | ||||
-rwxr-xr-x | scripts/osx/run.sh | 27 | ||||
-rwxr-xr-x | scripts/package_ios.sh (renamed from scripts/ios/package.sh) | 0 | ||||
-rwxr-xr-x | scripts/publish_ios.sh (renamed from scripts/ios/publish.sh) | 0 | ||||
-rwxr-xr-x | scripts/travis_before_install.sh | 53 | ||||
-rwxr-xr-x | scripts/travis_helper.sh | 26 | ||||
-rwxr-xr-x | scripts/travis_script.sh | 62 | ||||
-rwxr-xr-x | scripts/xcpretty.sh | 3 |
26 files changed, 203 insertions, 302 deletions
diff --git a/scripts/android/install.sh b/scripts/android/install.sh deleted file mode 100755 index 656465cf2f..0000000000 --- a/scripts/android/install.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -source ./scripts/travis_helper.sh - -mapbox_time "checkout_mason" \ -git submodule update --init .mason - -export MASON_PLATFORM=android -export MASON_ANDROID_ABI=${ANDROID_ABI} - -mapbox_time "android_toolchain" \ -./scripts/android/toolchain.sh diff --git a/scripts/android/run.sh b/scripts/android/run.sh deleted file mode 100755 index 7a909ffe3c..0000000000 --- a/scripts/android/run.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -BUILDTYPE=${BUILDTYPE:-Release} -TESTMUNK=${TESTMUNK:-no} -export HOST=android -export MASON_PLATFORM=android -export MASON_ANDROID_ABI=${ANDROID_ABI:-arm-v7} - -source ./scripts/travis_helper.sh - -# Add Mason to PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -################################################################################ -# Build -################################################################################ - -mapbox_time "checkout_styles" \ -git submodule update --init styles - -mkdir -p ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw -echo "${MAPBOX_ACCESS_TOKEN}" > ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/token.txt - -mapbox_time "compile_library" \ -make android-lib -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "build_apk" \ -make android -j${JOBS} BUILDTYPE=${BUILDTYPE} - -################################################################################ -# Deploy -################################################################################ - -if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then - # Install and add awscli to PATH for uploading the results - mapbox_time "install_awscli" \ - pip install --user awscli - export PATH="`python -m site --user-base`/bin:${PATH}" - - mapbox_time_start "deploy_results" - echo "Deploying results..." - - S3_PREFIX=s3://mapbox/mapbox-gl-native/android/build/${TRAVIS_JOB_NUMBER} - APK_OUTPUTS=./android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk - - # Upload either the debug or the release build - if [ ${BUILDTYPE} == "Debug" ] ; then - aws s3 cp \ - ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-debug.apk \ - ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-debug.apk - elif [ ${BUILDTYPE} == "Release" ] ; then - aws s3 cp \ - ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-release-unsigned.apk \ - ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-release-unsigned.apk - fi - - mapbox_time_finish -fi diff --git a/scripts/android/toolchain.sh b/scripts/android/toolchain.sh deleted file mode 100755 index 67cd0aa476..0000000000 --- a/scripts/android/toolchain.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -export MASON_PLATFORM=android -export MASON_ANDROID_ABI=${MASON_ANDROID_ABI:-arm-v7} -export PATH="`pwd`/.mason:${PATH}" -export MASON_DIR="`pwd`/.mason" - -export PATH=`mason env PATH` - -echo MASON_PLATFORM=\"${MASON_PLATFORM}\" -echo MASON_ANDROID_ABI=\"${MASON_ANDROID_ABI}\" -echo CXX=\"`which $(mason env CXX)`\" -echo CC=\"`which $(mason env CC)`\" -echo LD=\"`which $(mason env LD)`\" -echo LINK=\"`which $(mason env CXX)`\" -echo AR=\"`which $(mason env AR)`\" -echo RANLIB=\"`which $(mason env RANLIB)`\" -echo STRIP=\"`which $(mason env STRIP)`\" -echo LDFLAGS=\"`mason env LDFLAGS` \${LDFLAGS:-}\" -echo CFLAGS=\"`mason env CFLAGS` \${CFLAGS:-}\" -echo CXXFLAGS=\"`mason env CXXFLAGS` \${CXXFLAGS:-}\" -echo CPPFLAGS=\"`mason env CPPFLAGS` \${CPPFLAGS:-}\" -echo JNIDIR=\"`mason env JNIDIR`\" diff --git a/scripts/android_env.sh b/scripts/android_env.sh new file mode 100755 index 0000000000..93b1452a5a --- /dev/null +++ b/scripts/android_env.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +./scripts/local_mason.sh + +export MASON_PLATFORM=android + +export PATH=`.mason/mason env PATH` + +echo MASON_PLATFORM=\"android\" +echo MASON_ANDROID_ABI=\"${MASON_ANDROID_ABI}\" + +echo CXX=\"`which $(.mason/mason env CXX)`\" +echo CC=\"`which $(.mason/mason env CC)`\" +echo LD=\"`which $(.mason/mason env LD)`\" +echo LINK=\"`which $(.mason/mason env CXX)`\" +echo AR=\"`which $(.mason/mason env AR)`\" +echo RANLIB=\"`which $(.mason/mason env RANLIB)`\" +echo STRIP=\"`which $(.mason/mason env STRIP)`\" +echo LDFLAGS=\"`.mason/mason env LDFLAGS` ${LDFLAGS}\" +echo CFLAGS=\"`.mason/mason env CFLAGS` ${CFLAGS}\" +echo CPPFLAGS=\"`.mason/mason env CPPFLAGS` ${CPPFLAGS}\" +echo JNIDIR=\"`.mason/mason env JNIDIR`\" diff --git a/scripts/flags.sh b/scripts/flags.sh new file mode 100755 index 0000000000..10cc88e5c6 --- /dev/null +++ b/scripts/flags.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then + export DISPLAY=:99.0 + + if [[ ${MASON_PLATFORM} != "android" ]]; then + sh -e /etc/init.d/xvfb start + fi + + # use g++ that supports c++11 + if [[ ${CXX} == "g++" ]]; then + export CXX="g++-4.8" + export CC="gcc-4.8" + fi + + # If building in debug then turn on sanitizers. + # They should both work with latest g++/clang++ + # but it's not worth a standalone matrix so here + # we just test address->gcc and thread->clang for + # some limited coverage + # if [[ ${BUILDTYPE} == "Debug" ]]; then + # if [[ ${CXX} == "g++" ]]; then + # export CXXFLAGS="-fsanitize=address -g ${CXXFLAGS}" + # export CFLAGS="-fsanitize=address -g ${CFLAGS}" + # export LDFLAGS="-fsanitize=address ${LDFLAGS}" + # elif [[ ${CXX} == "clang++" ]]; then + # export CXXFLAGS="-fsanitize=thread -g -fPIC ${CXXFLAGS}" + # export CFLAGS="-fsanitize=thread -g ${CFLAGS}" + # export LDFLAGS="-fsanitize=thread -pie ${LDFLAGS}" + # fi + # fi +fi diff --git a/scripts/install_node.sh b/scripts/install_node.sh new file mode 100755 index 0000000000..ecb5b88350 --- /dev/null +++ b/scripts/install_node.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +mason install node 0.10.35 +export PATH="`mason prefix node 0.10.35`/bin":"$PATH" diff --git a/scripts/ios/install.sh b/scripts/ios/install.sh deleted file mode 100755 index 1994d371d0..0000000000 --- a/scripts/ios/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -source ./scripts/travis_helper.sh - -mapbox_time "checkout_mason" \ -git submodule update --init .mason -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -mapbox_time "install_xcpretty" \ -gem install xcpretty --no-rdoc --no-ri --no-document --quiet diff --git a/scripts/ios/run.sh b/scripts/ios/run.sh deleted file mode 100755 index 6eed14a598..0000000000 --- a/scripts/ios/run.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -BUILDTYPE=${BUILDTYPE:-Release} - -source ./scripts/travis_helper.sh - -# Add Mason to PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -################################################################################ -# Build -################################################################################ - -mapbox_time "package_ios" \ -make ipackage - -################################################################################ -# Deploy -################################################################################ - -if [[ -n "$PUBLISH_TAG" ]]; then - mapbox_time "deploy_ios" \ - ./scripts/ios/publish.sh "$PUBLISH_VERSION" -fi diff --git a/scripts/ios/add-key.sh b/scripts/ios_travis/add-key.sh index fe963d38eb..b581445303 100755 --- a/scripts/ios/add-key.sh +++ b/scripts/ios_travis/add-key.sh @@ -16,10 +16,10 @@ security unlock-keychain -p travis ios-build.keychain security set-keychain-settings -t 3600 -l ~/Library/Keychains/ios-build.keychain # Add certificates to keychain and allow codesign to access them -security import ./scripts/ios/apple.crt -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign -security import ./scripts/ios/ios-dist.cer -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign -security import ./scripts/ios/ios-dist.p12 -k ~/Library/Keychains/ios-build.keychain -P $IOS_KEY_PASSWORD -T /usr/bin/codesign +security import ./scripts/ios_travis/apple.crt -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign +security import ./scripts/ios_travis/ios-dist.cer -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign +security import ./scripts/ios_travis/ios-dist.p12 -k ~/Library/Keychains/ios-build.keychain -P $IOS_KEY_PASSWORD -T /usr/bin/codesign # Put the provisioning profile in place mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles -cp "./scripts/ios/$IOS_PROFILE_NAME.mobileprovision" ~/Library/MobileDevice/Provisioning\ Profiles/ +cp "./scripts/ios_travis/$IOS_PROFILE_NAME.mobileprovision" ~/Library/MobileDevice/Provisioning\ Profiles/ diff --git a/scripts/ios/apple.crt b/scripts/ios_travis/apple.crt Binary files differindex 0de099b869..0de099b869 100644 --- a/scripts/ios/apple.crt +++ b/scripts/ios_travis/apple.crt diff --git a/scripts/ios/ios-dist.cer.enc b/scripts/ios_travis/ios-dist.cer.enc index dfdd0ca997..dfdd0ca997 100644 --- a/scripts/ios/ios-dist.cer.enc +++ b/scripts/ios_travis/ios-dist.cer.enc diff --git a/scripts/ios/ios-dist.p12.enc b/scripts/ios_travis/ios-dist.p12.enc index ad6507ef9f..ad6507ef9f 100644 --- a/scripts/ios/ios-dist.p12.enc +++ b/scripts/ios_travis/ios-dist.p12.enc diff --git a/scripts/ios/ios-in-house.mobileprovision.enc b/scripts/ios_travis/ios-in-house.mobileprovision.enc index 51036a7415..51036a7415 100644 --- a/scripts/ios/ios-in-house.mobileprovision.enc +++ b/scripts/ios_travis/ios-in-house.mobileprovision.enc diff --git a/scripts/ios/remove-key.sh b/scripts/ios_travis/remove-key.sh index 56b769ac21..56b769ac21 100755 --- a/scripts/ios/remove-key.sh +++ b/scripts/ios_travis/remove-key.sh diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh deleted file mode 100755 index a47155d69f..0000000000 --- a/scripts/linux/install.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -source ./scripts/travis_helper.sh - -mapbox_time "update_apt" \ -sudo apt-get -y update - -mapbox_time "install_apt" \ -sudo apt-get -y install mesa-utils llvm-3.4 pkg-config libcurl4-openssl-dev \ - libboost-dev libboost-program-options-dev libxi-dev x11proto-randr-dev \ - x11proto-xext-dev libxrandr-dev x11proto-xf86vidmode-dev libxxf86vm-dev \ - libxcursor-dev libxinerama-dev - -mapbox_time "checkout_mason" \ -git submodule update --init .mason -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -mapbox_time "install_mesa" \ -mason install mesa 10.4.3 diff --git a/scripts/linux/run.sh b/scripts/linux/run.sh deleted file mode 100755 index c4731b97ec..0000000000 --- a/scripts/linux/run.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -BUILDTYPE=${BUILDTYPE:-Release} - -source ./scripts/travis_helper.sh - -# Add Mason to PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -# Set the core file limit to unlimited so a core file is generated upon crash -ulimit -c unlimited -S - -################################################################################ -# X Server setup -################################################################################ - -# Start the mock X server -if [ -f /etc/init.d/xvfb ] ; then - mapbox_time "start_xvfb" \ - sh -e /etc/init.d/xvfb start - sleep 2 # sometimes, xvfb takes some time to start up -fi - -# Make sure we're connecting to xvfb -export DISPLAY=:99.0 - -# Make sure we're loading the 10.4.3 libs we installed manually -export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}" - -mapbox_time "glxinfo" \ -glxinfo - -################################################################################ -# Build -################################################################################ - -mapbox_time "checkout_styles" \ -git submodule update --init styles - -mapbox_time "compile_program" \ -make linux -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "compile_tests" \ -make test -j${JOBS} BUILDTYPE=${BUILDTYPE} - -################################################################################ -# Test -################################################################################ - -mapbox_time "checkout_test_suite" \ -git submodule update --init test/suite - -mapbox_time "run_tests" \ -make test-* BUILDTYPE=${BUILDTYPE} - -mapbox_time "compare_results" \ -./scripts/compare_images.sh - -################################################################################ -# Deploy -################################################################################ - -if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then - # Install and add awscli to PATH for uploading the results - mapbox_time "install_awscli" \ - pip install --user awscli - export PATH="`python -m site --user-base`/bin:${PATH}" - - mapbox_time_start "deploy_results" - (cd ./test/suite/ && ./bin/deploy_results.sh) - mapbox_time_finish -fi diff --git a/scripts/local_mason.sh b/scripts/local_mason.sh new file mode 100755 index 0000000000..2d8687a280 --- /dev/null +++ b/scripts/local_mason.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +git submodule update --init .mason +PATH=`pwd`/.mason:$PATH +export MASON_DIR=`pwd`/.mason diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh new file mode 100755 index 0000000000..7437af9619 --- /dev/null +++ b/scripts/npm_install.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +cd bin +$1 install --clang=1 +cd ../ diff --git a/scripts/osx/install.sh b/scripts/osx/install.sh deleted file mode 100755 index 1994d371d0..0000000000 --- a/scripts/osx/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -source ./scripts/travis_helper.sh - -mapbox_time "checkout_mason" \ -git submodule update --init .mason -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -mapbox_time "install_xcpretty" \ -gem install xcpretty --no-rdoc --no-ri --no-document --quiet diff --git a/scripts/osx/run.sh b/scripts/osx/run.sh deleted file mode 100755 index b84ed04c21..0000000000 --- a/scripts/osx/run.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -BUILDTYPE=${BUILDTYPE:-Release} - -source ./scripts/travis_helper.sh - -# Add Mason to PATH -export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" - -# Set the core file limit to unlimited so a core file is generated upon crash -ulimit -c unlimited -S - -################################################################################ -# Build -################################################################################ - -mapbox_time "checkout_styles" \ -git submodule update --init styles - -mapbox_time "compile_program" \ -make xosx -j${JOBS} BUILDTYPE=${BUILDTYPE} - -mapbox_time "compile_tests" \ -make xtest -j${JOBS} BUILDTYPE=${BUILDTYPE} diff --git a/scripts/ios/package.sh b/scripts/package_ios.sh index da55b297ae..da55b297ae 100755 --- a/scripts/ios/package.sh +++ b/scripts/package_ios.sh diff --git a/scripts/ios/publish.sh b/scripts/publish_ios.sh index f65f3e5609..f65f3e5609 100755 --- a/scripts/ios/publish.sh +++ b/scripts/publish_ios.sh diff --git a/scripts/travis_before_install.sh b/scripts/travis_before_install.sh new file mode 100755 index 0000000000..f837e74161 --- /dev/null +++ b/scripts/travis_before_install.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then + # + # install Linux dependencies + # + if [[ `lsb_release -r` =~ "12.04" ]]; then + sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test + fi + sudo add-apt-repository --yes ppa:boost-latest/ppa + + mapbox_time "apt_update" \ + sudo apt-get update -y + + mapbox_time "install_gcc" \ + sudo apt-get -y install gcc-4.8 g++-4.8 + + mapbox_time "install_build_tools" \ + sudo apt-get -y install git build-essential zlib1g-dev automake gdb \ + libtool xutils-dev make cmake pkg-config python-pip \ + libboost1.55-dev libcurl4-openssl-dev \ + libpng-dev libsqlite3-dev + + if [[ ${MASON_PLATFORM} != "android" ]]; then + mapbox_time "install_opengl" \ + sudo apt-get -y install mesa-utils libxi-dev x11proto-randr-dev \ + x11proto-xext-dev libxrandr-dev \ + x11proto-xf86vidmode-dev libxxf86vm-dev \ + libxcursor-dev libxinerama-dev \ + llvm-3.4 # required for mesa + + mapbox_time "install_mesa" \ + mason install mesa 10.4.3 + fi + + mapbox_time "install_awscli" \ + sudo pip install awscli +elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then + # + # install OS X dependencies + # + mapbox_time "install_build_tools" \ + brew install git + + mapbox_time "install_awscli" \ + sudo pip install awscli + + mapbox_time "install_xcpretty" \ + gem install xcpretty --no-rdoc --no-ri --no-document --quiet +fi diff --git a/scripts/travis_helper.sh b/scripts/travis_helper.sh index 13e1f44979..c42ce215e3 100755 --- a/scripts/travis_helper.sh +++ b/scripts/travis_helper.sh @@ -1,19 +1,13 @@ #!/usr/bin/env bash -case `uname -s` in - 'Darwin') JOBS=$((`sysctl -n hw.ncpu` + 2)) ;; - 'Linux') JOBS=$((`nproc` + 2)) ;; - *) JOBS=2 ;; -esac - function mapbox_time_start { local name=$1 mapbox_timer_name=$name - mapbox_fold start $name + travis_fold start $name mapbox_timer_id=$(printf %08x $(( RANDOM * RANDOM ))) - eval "mapbox_start_time_$mapbox_timer_id=$(mapbox_nanoseconds)" + eval "mapbox_start_time_$mapbox_timer_id=$(travis_nanoseconds)" echo -en "travis_time:start:$mapbox_timer_id\n" } @@ -22,11 +16,11 @@ function mapbox_time_finish { local timer_id=${2:-$mapbox_timer_id} local timer_start="mapbox_start_time_$timer_id" eval local start_time=\${$timer_start} - local end_time=$(mapbox_nanoseconds) + local end_time=$(travis_nanoseconds) local duration=$(($end_time-$start_time)) echo -en "travis_time:end:$timer_id:start=$start_time,finish=$end_time,duration=$duration\n" - mapbox_fold end $name + travis_fold end $name } function mapbox_time { @@ -38,13 +32,13 @@ function mapbox_time { mapbox_time_finish $name $timer_id } -function mapbox_fold { +if [[ "${TRAVIS_COMMIT:-false}" == false ]]; then +function travis_fold { local action=$1 local name=$2 echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}" } - -function mapbox_nanoseconds { +function travis_nanoseconds { local cmd="date" local format="+%s%N" local os=$(uname) @@ -57,11 +51,11 @@ function mapbox_nanoseconds { $cmd -u $format } +fi -export JOBS export ANSI_CLEAR -export -f mapbox_fold -export -f mapbox_nanoseconds +export -f travis_fold +export -f travis_nanoseconds export -f mapbox_time export -f mapbox_time_start export -f mapbox_time_finish diff --git a/scripts/travis_script.sh b/scripts/travis_script.sh new file mode 100755 index 0000000000..0351f94144 --- /dev/null +++ b/scripts/travis_script.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +COMMIT_MESSAGE=$(git show -s --format=%B $1 | tr -d '\n') +PUBLISH_TAG=$(echo "$COMMIT_MESSAGE" | grep -oE '\[publish [a-z0-9\.\-]+\]' | grep -oE '[a-z0-9\.\-]+' | tail -n1) +PUBLISH_PLATFORM=$(echo "$PUBLISH_TAG" | awk -F '-v' '{ print $1 }') +PUBLISH_VERSION=$(echo "$PUBLISH_TAG" | awk -F '-v' '{ print $2 }') + +set -e +set -o pipefail + +mapbox_time "checkout_styles" \ +git submodule update --init styles + +if [[ $MASON_PLATFORM == "android" ]]; then + ./android/scripts/run-build.sh + +elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then + # + # build & test Linux + # + mapbox_time "compile_program" \ + make linux -j$JOBS BUILDTYPE=${BUILDTYPE} + + mapbox_time "compile_tests" \ + make test -j$JOBS BUILDTYPE=${BUILDTYPE} + + mapbox_time "checkout_test_suite" \ + git submodule update --init test/suite + + mapbox_time "run_tests" \ + make test-* BUILDTYPE=${BUILDTYPE} + + mapbox_time "compare_results" \ + ./scripts/compare_images.sh + + if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then + mapbox_time_start "deploy_results" + (cd ./test/suite/ && ./bin/deploy_results.sh) + mapbox_time_finish + fi + +elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "osx" ]]; then + # + # build OS X + # + mapbox_time "build_osx" \ + make xosx -j$JOBS + +elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "ios" ]]; then + # + # build & package iOS + # + mapbox_time "package_ios" + make ipackage + # + # conditionally deploy iOS build + # + if [[ -n "$PUBLISH_TAG" ]]; then + mapbox_time "deploy_ios" + ./scripts/publish_ios.sh "$PUBLISH_VERSION" + fi +fi diff --git a/scripts/xcpretty.sh b/scripts/xcpretty.sh deleted file mode 100755 index c39f588220..0000000000 --- a/scripts/xcpretty.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -FN=$(which xcpretty) ; [ ! -z ${FN} ] && echo "| ${FN}" |