summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-08-25 17:07:19 -0400
committerMike Morris <michael.patrick.morris@gmail.com>2015-08-25 17:07:19 -0400
commita622bb47564b7cb6b37a6a1e2387816da3137af1 (patch)
tree3d5b52ac8d48969bb0ef6b80c26c4fa876c23f13 /scripts
parent96d59900892cb7cc4ec23121b231514da910d8eb (diff)
downloadqtlocation-mapboxgl-a622bb47564b7cb6b37a6a1e2387816da3137af1.tar.gz
add FLAVOR=node to build matrix
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/node/after_script.sh32
-rw-r--r--scripts/node/install.sh22
-rw-r--r--scripts/node/run.sh31
3 files changed, 85 insertions, 0 deletions
diff --git a/scripts/node/after_script.sh b/scripts/node/after_script.sh
new file mode 100755
index 0000000000..c757a1b8ca
--- /dev/null
+++ b/scripts/node/after_script.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+set -e
+set -o pipefail
+
+# Inspect binary.
+if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
+ ldd ./lib/mapbox-gl-native.node
+else
+ otool -L ./lib/mapbox-gl-native.node
+fi
+
+COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
+
+if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then
+ npm install aws-sdk
+
+ ./node_modules/.bin/node-pre-gyp package
+
+ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
+ ./node_modules/.bin/node-pre-gyp testpackage
+ fi
+
+ ./node_modules/.bin/node-pre-gyp publish info
+
+ if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
+ rm -rf build
+ rm -rf lib
+ npm install --fallback-to-build=false
+ npm test
+ fi
+fi
diff --git a/scripts/node/install.sh b/scripts/node/install.sh
new file mode 100644
index 0000000000..e804d47fa0
--- /dev/null
+++ b/scripts/node/install.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+mapbox_time "checkout_mason" \
+git submodule update --init .mason
+
+PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" \
+
+if [ ${TRAVIS_OS_NAME} == "linux" ]; then
+ mapbox_time "install_mesa" \
+ mason install mesa 10.4.3
+fi
+
+mapbox_time $NODE_EXE \
+mason install $NODE_EXE $NODE_VERSION
+
+export PATH="`mason prefix $NODE_EXE $NODE_VERSION`/bin":"$PATH"
+
+$NODE_EXE --version
+npm --version
diff --git a/scripts/node/run.sh b/scripts/node/run.sh
new file mode 100644
index 0000000000..f36ea02a12
--- /dev/null
+++ b/scripts/node/run.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+source ./scripts/${TRAVIS_OS_NAME}/setup.sh
+
+BUILDTYPE=${BUILDTYPE:-Release}
+
+################################################################################
+# Build
+################################################################################
+
+mapbox_time "checkout_styles" \
+git submodule update --init styles
+
+mapbox_time "compile_program" \
+cd platform/node && BUILDTYPE=${BUILDTYPE} npm install --build-from-source
+
+################################################################################
+# Test
+################################################################################
+
+mapbox_time "checkout_test_suite" \
+git submodule update --init test/suite
+
+mapbox_time "run_tests" \
+npm test
+
+mapbox_time "run_render_tests" \
+npm run test-suite