summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-05-24 11:10:36 +0300
committerKonstantin Käfer <mail@kkaefer.com>2017-06-22 13:33:16 -0700
commit461387343ddbc209019f96f86328abf4994275b7 (patch)
treef14dd8395c9ed9f1be5dcabbb97771ee15f3053a /scripts
parent3a0c5b046c6405864e07234f54b99ae0930bc539 (diff)
downloadqtlocation-mapboxgl-461387343ddbc209019f96f86328abf4994275b7.tar.gz
[build] Switch from Travis CI to CircleCI
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/circle_setup.sh35
-rwxr-xr-xscripts/travis_helper.sh73
-rwxr-xr-xscripts/travis_setup.sh77
3 files changed, 35 insertions, 150 deletions
diff --git a/scripts/circle_setup.sh b/scripts/circle_setup.sh
new file mode 100755
index 0000000000..308cac34fb
--- /dev/null
+++ b/scripts/circle_setup.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# This script is sourced; do not set -e or -o pipefail here.
+
+# Touch package.json so that we are definitely going to run an npm update action
+touch package.json
+
+function mapbox_install_logbt {
+ export PATH=$(scripts/mason.sh PREFIX gdb VERSION 7.12)/bin:${PATH}
+ curl -sSfL https://github.com/mapbox/logbt/archive/v2.0.1.tar.gz | tar --gunzip --extract --strip-components=2 --exclude="*md" --exclude="test*" --directory=.
+ ./logbt --test
+}
+
+export -f mapbox_install_logbt
+
+function mapbox_install_apitrace {
+ export PATH=$(scripts/mason.sh PREFIX apitrace VERSION 6a30de1)/bin:${PATH}
+}
+
+export -f mapbox_install_apitrace
+
+function mapbox_export_mesa_library_path {
+ # Install and set up to load a more recent version of mesa
+ MESA_PREFIX=$(scripts/mason.sh PREFIX mesa VERSION 13.0.4)
+ export LD_LIBRARY_PATH="${MESA_PREFIX}/lib:${LD_LIBRARY_PATH:-}"
+ export LIBGL_DRIVERS_PATH="${MESA_PREFIX}/lib/dri"
+}
+
+export -f mapbox_export_mesa_library_path
+
+# Install and set up to load awscli
+pip install --user awscli
+export PATH="`python -m site --user-base`/bin:${PATH}"
+
+# Install coveralls gem
+gem install coveralls-lcov --no-rdoc --no-ri
diff --git a/scripts/travis_helper.sh b/scripts/travis_helper.sh
deleted file mode 100755
index 5a765b131d..0000000000
--- a/scripts/travis_helper.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env bash
-
-# This script is sourced, so do not set -e or -o pipefail here. Doing so would
-# bleed into Travis' wrapper script, which messes with their workflow, e.g.
-# preventing after_failure scripts to be triggered.
-
-case `uname -s` in
- 'Darwin') JOBS=$((`sysctl -n hw.ncpu` + 2)) ;;
- 'Linux') JOBS=$((`nproc` + 2)) ;;
- *) JOBS=2 ;;
-esac
-
-ANSI_CLEAR="\e[0m"
-
-function mapbox_time_start {
- local name=$1
- mapbox_timer_name=$name
-
- mapbox_fold start $name
-
- mapbox_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
- eval "mapbox_start_time_$mapbox_timer_id=$(mapbox_nanoseconds)"
- echo -en "travis_time:start:$mapbox_timer_id\n"
-}
-
-function mapbox_time_finish {
- local name=${1:-$mapbox_timer_name}
- 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 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
-}
-
-function mapbox_time {
- local name=$1 ; shift
- mapbox_time_start $name
- local timer_id=$mapbox_timer_id
- echo "\$ $@"
- $@
- mapbox_time_finish $name $timer_id
-}
-
-function mapbox_fold {
- local action=$1
- local name=$2
- echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
-}
-
-function mapbox_nanoseconds {
- local cmd="date"
- local format="+%s%N"
- local os=$(uname)
-
- if hash gdate > /dev/null 2>&1; then
- cmd="gdate" # use gdate if available
- elif [[ "$os" = Darwin ]]; then
- format="+%s000000000" # fallback to second precision on darwin (does not support %N)
- fi
-
- $cmd -u $format
-}
-
-export JOBS
-export ANSI_CLEAR
-export -f mapbox_fold
-export -f mapbox_nanoseconds
-export -f mapbox_time
-export -f mapbox_time_start
-export -f mapbox_time_finish
diff --git a/scripts/travis_setup.sh b/scripts/travis_setup.sh
deleted file mode 100755
index ed887008d5..0000000000
--- a/scripts/travis_setup.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env bash
-# This script is sourced; do not set -e or -o pipefail here.
-
-if [ ! -z "${_CXX}" ]; then export CXX="${_CXX}" ; fi
-if [ ! -z "${_CC}" ]; then export CC="${_CC}" ; fi
-
-if [ "${CCACHE:-0}" -ge 1 ]; then
- export CXX="ccache ${CXX}"
- export CC="ccache ${CC}"
-
- # ccache splits up the compile steps, so we end up with unused arguments in some steps.
- # Clang also thinks that ccache isn't interactive, so we explicitly need to enable color.
- if [ $(echo | ${CXX} -dM -E - | grep -c "#define __clang__ 1") -ge 1 ]; then
- export CXX="${CXX} -Qunused-arguments -fcolor-diagnostics"
- export CC="${CC} -Qunused-arguments -fcolor-diagnostics"
- else
- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60304
- # GCC normally throws this error which is in GTest, but *only* when compilation and
- # preprocessing aren't combined in one step. However, when using ccache with GCC, we are
- # running them in separate steps, so this warning/error is shown.
- export CXX="${CXX} -Wno-conversion-null"
- export CC="${CC} -Wno-conversion-null"
- fi
-fi
-
-echo "export CXX=\"${CXX}\""
-echo "export CC=\"${CC}\""
-if [ -x $(which ${CXX}) ]; then
- ${CXX} --version
-fi
-
-# Touch package.json so that we are definitely going to run an npm update action
-mapbox_time "touch_package_json" \
-touch package.json
-
-function mapbox_install_gdb_logbt {
- scripts/mason.sh INSTALL gdb VERSION 2017-04-08-aebcde5
- export PATH=$(scripts/mason.sh PREFIX gdb VERSION 2017-04-08-aebcde5)/bin:${PATH}
- curl -sSfL https://github.com/mapbox/logbt/archive/v2.0.1.tar.gz | tar --gunzip --extract --strip-components=2 --exclude="*md" --exclude="test*" --directory=.
- sudo ./logbt --setup
- ./logbt --test
-}
-
-function mapbox_start_xvfb {
- if [ ! -f /etc/init.d/xvfb ]; then
- echo "Error: Could not start Xvfb mock server."
- exit 1
- fi
-
- mapbox_time "start_xvfb" \
- sh -e /etc/init.d/xvfb start
- sleep 2 # sometimes, xvfb takes some time to start up
-
- # Make sure we're connecting to xvfb
- export DISPLAY=:99.0
-}
-
-export -f mapbox_start_xvfb
-
-function mapbox_export_mesa_library_path {
- # Install and set up to load a more recent version of mesa
- mapbox_time "install_mesa" \
- scripts/mason.sh install mesa VERSION 13.0.4
-
- MESA_PREFIX=`scripts/mason.sh PREFIX mesa VERSION 13.0.4`
- export LD_LIBRARY_PATH="${MESA_PREFIX}/lib:${LD_LIBRARY_PATH:-}"
- export LIBGL_DRIVERS_PATH="${MESA_PREFIX}/lib/dri"
-}
-
-export -f mapbox_export_mesa_library_path
-
-# Install and set up to load awscli
-pip install --user awscli
-export PATH="`python -m site --user-base`/bin:${PATH}"
-
-# Install coveralls gem
-gem install coveralls-lcov --no-rdoc --no-ri