summaryrefslogtreecommitdiff
path: root/scripts/node/run.sh
blob: 8e543fecfcf90d933f7cee76a6300bbc2b30ed8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash

set -e
set -o pipefail

source ./scripts/${TRAVIS_OS_NAME}/setup.sh

BUILDTYPE=${BUILDTYPE:-Release}

################################################################################
# Build
################################################################################

. ~/.nvm/nvm.sh
nvm use $NODE_VERSION

mapbox_time "checkout_styles" \
git submodule update --init styles

mapbox_time "compile_program" \
pushd platform/node && npm install --build-from-source && popd

################################################################################
# Test
################################################################################

# Travis OS X has no GPU
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
    mapbox_time "checkout_test_suite" \
    git submodule update --init test/suite

    mapbox_time "run_tests" \
    pushd platform/node && npm test && popd

    mapbox_time "run_render_tests" \
    pushd platform/node && npm run test-suite && popd

    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 "deploy_results" \
        pushd test/suite && ./bin/deploy_results.sh && popd
    fi
fi