remove spaces from fold command and put in separate file

This commit is contained in:
Konstantin Käfer
2014-10-16 05:50:10 -07:00
parent e211ee620d
commit 3d6304e8c3
5 changed files with 35 additions and 26 deletions

View File

@@ -1,13 +1,6 @@
#!/usr/bin/env bash
function mapbox_time {
local NAME=$1 ; shift
travis_fold start "${NAME}"
travis_time_start
"$@"
travis_time_finish
travis_fold end "${NAME}"
}
. ./scripts/travis_helper.sh
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
export DISPLAY=:99.0

View File

@@ -3,6 +3,8 @@
set -e
set -o pipefail
. ./scripts/travis_helper.sh
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
#
# install Linux dependencies
@@ -11,30 +13,30 @@ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
fi
mapbox_time "apt update" \
mapbox_time "apt_update" \
sudo apt-get update -y
mapbox_time "install gcc" \
mapbox_time "install_gcc" \
sudo apt-get -y install gcc-4.8 g++-4.8
mapbox_time "install build tools" \
mapbox_time "install_build_tools" \
sudo apt-get -y install git build-essential zlib1g-dev automake \
libtool xutils-dev make cmake pkg-config python-pip
mapbox_time "install opengl" \
mapbox_time "install_opengl" \
sudo apt-get -y install libxi-dev libglu1-mesa-dev x11proto-randr-dev \
x11proto-xext-dev libxrandr-dev \
x11proto-xf86vidmode-dev libxxf86vm-dev libxcursor-dev
mapbox_time "install awscli" \
mapbox_time "install_awscli" \
sudo pip install awscli
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
#
# install OS X dependencies
#
mapbox_time "install build tools" \
mapbox_time "install_build_tools" \
brew install autoconf automake libtool makedepend cmake pkg-config node git
mapbox_time "install awscli" \
mapbox_time "install_awscli" \
sudo pip install awscli
fi

10
scripts/travis_helper.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
function mapbox_time {
local NAME=$1 ; shift
travis_fold start "${NAME}"
travis_time_start
"$@"
travis_time_finish
travis_fold end "${NAME}"
}

View File

@@ -1,9 +1,11 @@
#!/usr/bin/env bash
. ./scripts/travis_helper.sh
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
#
# we'll need the test suite on Linux
#
mapbox_time "install test suite" \
mapbox_time "install_test_suite" \
npm install git+https://github.com/mapbox/mapbox-gl-test-suite.git
fi

View File

@@ -3,24 +3,26 @@
set -e
set -o pipefail
. ./scripts/travis_helper.sh
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
#
# build & test Linux
#
mapbox_time "compile program" \
mapbox_time "compile_program" \
make linux -j4 BUILDTYPE=${BUILDTYPE}
mapbox_time "install tests" \
mapbox_time "install_tests" \
make test -j4 BUILDTYPE=${BUILDTYPE}
mapbox_time "run tests" \
mapbox_time "run_tests" \
./scripts/run_tests.sh
mapbox_time "compare results" \
mapbox_time "compare_results" \
(cd ./node_modules/mapbox-gl-test-suite/ && (./bin/compare_images.js || true))
if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
mapbox_time "deploy results" \
mapbox_time "deploy_results" \
(cd ./node_modules/mapbox-gl-test-suite/ && ./bin/deploy_results.sh)
fi
@@ -28,10 +30,10 @@ elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
#
# build OS X
#
mapbox_time "create osx project" \
mapbox_time "create_osx_project" \
make xproj-cli
mapbox_time "build osx" \
mapbox_time "build_osx" \
xcodebuild -project ./build/macosx/mapboxgl-app.xcodeproj -jobs 4
#
@@ -39,12 +41,12 @@ elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
#
git submodule init
mapbox_time "load submodules" \
mapbox_time "load_submodules" \
git submodule update
mapbox_time "create ios project" \
mapbox_time "create_ios_project" \
make iproj-cli
mapbox_time "build ios" \
mapbox_time "build_ios" \
xcodebuild -project ./build/ios/mapbox-gl-cocoa/app/mapboxgl-app.xcodeproj -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO -jobs 4
fi