ci: redo how env variables are set and shared in ci to prevent collisions
This commit is contained in:
parent
91fe3aadbc
commit
b8f0c3dc7b
17
.travis.yml
17
.travis.yml
|
@ -10,6 +10,7 @@ addons:
|
||||||
# needed to install g++ that is used by npms's native modules
|
# needed to install g++ that is used by npms's native modules
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
packages:
|
packages:
|
||||||
|
# needed to install g++ that is used by npms's native modules
|
||||||
- g++-4.8
|
- g++-4.8
|
||||||
# https://docs.travis-ci.com/user/jwt
|
# https://docs.travis-ci.com/user/jwt
|
||||||
jwt:
|
jwt:
|
||||||
|
@ -54,17 +55,17 @@ matrix:
|
||||||
- env: "CI_MODE=browserstack_optional"
|
- env: "CI_MODE=browserstack_optional"
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- ./scripts/ci-lite/env.sh print
|
- source ./scripts/ci/env.sh print
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ./scripts/ci-lite/install.sh
|
- ./scripts/ci/install.sh
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./scripts/ci-lite/build.sh
|
- ./scripts/ci/build.sh
|
||||||
- ./scripts/ci-lite/test.sh
|
- ./scripts/ci/test.sh
|
||||||
# deploy is part of 'script' and not 'after_success' so that we fail the build if the deployment fails
|
# deploy is part of 'script' and not 'after_success' so that we fail the build if the deployment fails
|
||||||
- ./scripts/ci-lite/deploy.sh
|
- ./scripts/ci/deploy.sh
|
||||||
- ./scripts/ci-lite/angular.sh
|
- ./scripts/ci/angular.sh
|
||||||
# all the scripts under this line will not quickly abort in case ${TRAVIS_TEST_RESULT} is 1 (job failure)
|
# all the scripts under this line will not quickly abort in case ${TRAVIS_TEST_RESULT} is 1 (job failure)
|
||||||
- ./scripts/ci-lite/cleanup.sh
|
- ./scripts/ci/cleanup.sh
|
||||||
- ./scripts/ci-lite/print-logs.sh
|
- ./scripts/ci/print-logs.sh
|
||||||
|
|
6
build.sh
6
build.sh
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly currentDir=$(cd $(dirname $0); pwd)
|
||||||
|
source ${currentDir}/scripts/ci/_travis-fold.sh
|
||||||
|
|
||||||
cd `dirname $0`
|
# TODO(i): wrap into subshell, so that we don't pollute CWD, but not yet to minimize diff collision with Jason
|
||||||
|
cd ${currentDir}
|
||||||
|
|
||||||
PACKAGES=(core
|
PACKAGES=(core
|
||||||
compiler
|
compiler
|
||||||
|
|
|
@ -125,7 +125,7 @@ $ cp tools/@angular/tsc-wrapped/package.json dist/tools/@angular/tsc-wrapped
|
||||||
|
|
||||||
# Run the test once
|
# Run the test once
|
||||||
# (First edit the LINKABLE_PKGS to use npm link instead of npm install)
|
# (First edit the LINKABLE_PKGS to use npm link instead of npm install)
|
||||||
$ ./scripts/ci-lite/offline_compiler_test.sh
|
$ ./scripts/ci/offline_compiler_test.sh
|
||||||
|
|
||||||
# Keep a package fresh in watch mode
|
# Keep a package fresh in watch mode
|
||||||
./node_modules/.bin/tsc -p modules/@angular/compiler/tsconfig-es5.json -w
|
./node_modules/.bin/tsc -p modules/@angular/compiler/tsconfig-es5.json -w
|
||||||
|
|
|
@ -13,8 +13,10 @@ function travisFoldStart() {
|
||||||
travisFoldStack+=("${sanitizedFoldName}|${foldStartTime}")
|
travisFoldStack+=("${sanitizedFoldName}|${foldStartTime}")
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "travis_fold:start:${sanitizedFoldName}"
|
if [[ ${TRAVIS:-} ]]; then
|
||||||
echo "travis_time:start:${sanitizedFoldName}"
|
echo "travis_fold:start:${sanitizedFoldName}"
|
||||||
|
echo "travis_time:start:${sanitizedFoldName}"
|
||||||
|
fi
|
||||||
local enterArrow="===> ${foldName} ==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>"
|
local enterArrow="===> ${foldName} ==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>==>"
|
||||||
# keep all messages consistently wide 80chars regardless of the foldName
|
# keep all messages consistently wide 80chars regardless of the foldName
|
||||||
echo ${enterArrow:0:100}
|
echo ${enterArrow:0:100}
|
||||||
|
@ -37,13 +39,16 @@ function travisFoldEnd() {
|
||||||
# split the string by | and then turn that into an array
|
# split the string by | and then turn that into an array
|
||||||
local lastFoldArray=(${lastFoldString//\|/ })
|
local lastFoldArray=(${lastFoldString//\|/ })
|
||||||
local lastSanitizedFoldName=${lastFoldArray[0]}
|
local lastSanitizedFoldName=${lastFoldArray[0]}
|
||||||
local lastFoldStartTime=${lastFoldArray[1]}
|
|
||||||
local foldFinishTime=$(date +%s%N)
|
|
||||||
local foldDuration=$(expr ${foldFinishTime} - ${lastFoldStartTime})
|
|
||||||
|
|
||||||
# write into build-perf.log file
|
if [[ ${TRAVIS:-} ]]; then
|
||||||
local logIndent=$(expr ${lastFoldIndex} \* 2)
|
local lastFoldStartTime=${lastFoldArray[1]}
|
||||||
printf "%6ss%${logIndent}s: %s\n" $(expr ${foldDuration} / 1000000000) " " "${foldName}" >> ${LOGS_DIR}/build-perf.log
|
local foldFinishTime=$(date +%s%N)
|
||||||
|
local foldDuration=$(expr ${foldFinishTime} - ${lastFoldStartTime})
|
||||||
|
|
||||||
|
# write into build-perf.log file
|
||||||
|
local logIndent=$(expr ${lastFoldIndex} \* 2)
|
||||||
|
printf "%6ss%${logIndent}s: %s\n" $(expr ${foldDuration} / 1000000000) " " "${foldName}" >> ${LOGS_DIR}/build-perf.log
|
||||||
|
fi
|
||||||
|
|
||||||
# pop
|
# pop
|
||||||
travisFoldStack=(${travisFoldStack[@]:0:lastFoldIndex})
|
travisFoldStack=(${travisFoldStack[@]:0:lastFoldIndex})
|
||||||
|
@ -58,8 +63,10 @@ function travisFoldEnd() {
|
||||||
# keep all messages consistently wide 80chars regardless of the foldName
|
# keep all messages consistently wide 80chars regardless of the foldName
|
||||||
echo ${returnArrow:0:100}
|
echo ${returnArrow:0:100}
|
||||||
echo ""
|
echo ""
|
||||||
echo "travis_time:end:${sanitizedFoldName}:start=${lastFoldStartTime},finish=${foldFinishTime},duration=${foldDuration}"
|
if [[ ${TRAVIS:-} ]]; then
|
||||||
echo "travis_fold:end:${sanitizedFoldName}"
|
echo "travis_time:end:${sanitizedFoldName}:start=${lastFoldStartTime},finish=${foldFinishTime},duration=${foldDuration}"
|
||||||
|
echo "travis_fold:end:${sanitizedFoldName}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# created based on the official Angular logo from https://angular.io/presskit.html
|
|
||||||
# converted using http://www.text-image.com/convert/
|
|
||||||
# colors added based on http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
|
|
||||||
|
|
||||||
|
|
||||||
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
||||||
if [[ ${TRAVIS_TEST_RESULT} == 1 ]]; then
|
# The variable is not set in early stages of the build, so we default to 0 there.
|
||||||
|
# https://docs.travis-ci.com/user/environment-variables/
|
||||||
|
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# this ascii art was created based on the official Angular logo from https://angular.io/presskit.html
|
||||||
|
# converted using http://www.text-image.com/convert/
|
||||||
|
# colors added based on http://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
LRED='\033[1;31m'
|
LRED='\033[1;31m'
|
||||||
WHITE='\033[1;37m'
|
WHITE='\033[1;37m'
|
||||||
|
|
|
@ -3,8 +3,16 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
|
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
||||||
|
# The variable is not set in early stages of the build, so we default to 0 there.
|
||||||
|
# https://docs.travis-ci.com/user/environment-variables/
|
||||||
|
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
travisFoldStart "tsc tools"
|
travisFoldStart "tsc tools"
|
||||||
|
|
|
@ -2,12 +2,9 @@
|
||||||
|
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# override test failure so that we perform this file regardless and not abort in env.sh
|
|
||||||
TRAVIS_TEST_RESULT=0
|
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
case ${CI_MODE} in
|
case ${CI_MODE} in
|
||||||
|
|
|
@ -3,15 +3,23 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
|
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
||||||
|
# The variable is not set in early stages of the build, so we default to 0 there.
|
||||||
|
# https://docs.travis-ci.com/user/environment-variables/
|
||||||
|
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Don't deploy if not running against angular/angular and not a PR
|
# Don't deploy if not running against angular/angular and not a PR
|
||||||
# TODO(i): because we don't let deploy to run outside of angular/angular folks can't use their
|
# TODO(i): because we don't let deploy to run outside of angular/angular folks can't use their
|
||||||
# private travis build to deploy anywhere. This is likely ok, but this means that @alexeagle's
|
# private travis build to deploy anywhere. This is likely ok, but this means that @alexeagle's
|
||||||
# fancy setup to publish ES2015 packages to github -build repos no longer works. This is ok
|
# fancy setup to publish ES2015 packages to github -build repos no longer works. This is ok
|
||||||
# since with megamodules we'll have this feature built-in. We should still go and remove
|
# since with flat modules we'll have this feature built-in. We should still go and remove
|
||||||
# stuff that Alex put in for this from publish-build-artifacts.sh
|
# stuff that Alex put in for this from publish-build-artifacts.sh
|
||||||
if [[ ${TRAVIS_REPO_SLUG} != "angular/angular" || ${TRAVIS_PULL_REQUEST} != "false" ]]; then
|
if [[ ${TRAVIS_REPO_SLUG} != "angular/angular" || ${TRAVIS_PULL_REQUEST} != "false" ]]; then
|
||||||
echo "Skipping deploy to staging because this is a PR build."
|
echo "Skipping deploy to staging because this is a PR build."
|
||||||
|
@ -22,7 +30,7 @@ fi
|
||||||
case ${CI_MODE} in
|
case ${CI_MODE} in
|
||||||
e2e)
|
e2e)
|
||||||
travisFoldStart "deploy.packages"
|
travisFoldStart "deploy.packages"
|
||||||
./scripts/publish/publish-build-artifacts.sh
|
${thisDir}/publish-build-artifacts.sh
|
||||||
travisFoldEnd "deploy.packages"
|
travisFoldEnd "deploy.packages"
|
||||||
;;
|
;;
|
||||||
aio)
|
aio)
|
||||||
|
|
|
@ -1,18 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
# because this script is being source-ed via .travis.yaml,
|
||||||
# The variable is not set in early stages of the build, so we default to 0 there.
|
# we need to restore the original options so that that we don't interfere with
|
||||||
# https://docs.travis-ci.com/user/environment-variables/
|
# travis' internals
|
||||||
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
readonly ORIGINAL_SHELL_OPTIONS=$(set +o)
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# set wasBashSetXOn using the current "set -x" mode state, so that we can restore it at the end
|
|
||||||
[[ "${-//[^x]/}" = "x" ]] && wasBashSetXOn=1 || wasBashSetXOn=0
|
|
||||||
|
|
||||||
# this script is extra noisy and used in many places during the build so we suppress the trace with +x to reduce the noise
|
# this script is extra noisy and used in many places during the build so we suppress the trace with +x to reduce the noise
|
||||||
set +x -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# sets and optionally prints environmental variable
|
# sets and optionally prints environmental variable
|
||||||
# usage: setEnvVar variableName variableValue
|
# usage: setEnvVar variableName variableValue
|
||||||
|
@ -26,14 +20,14 @@ function setEnvVar() {
|
||||||
export ${name}=${value}
|
export ${name}=${value}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# use BASH_SOURCE so that we get the right path when this script is called AND source-d
|
||||||
# strip leading "./"
|
readonly thisDir=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
|
||||||
currentFileName=${0#./}
|
|
||||||
currentWorkingDirectory=`pwd`
|
|
||||||
#cd ${currentWorkingDirectory%currentFileName}
|
|
||||||
readonly print=${1:-}
|
readonly print=${1:-}
|
||||||
# TODO(i): this won't work locally
|
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
# print bash version just so that we know what is running all the scripts
|
||||||
|
if [[ ${print} == "print" ]]; then
|
||||||
|
bash --version
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
|
@ -45,8 +39,7 @@ setEnvVar NPM_VERSION 3.10.7 # do not upgrade to >3.10.8 unless https://github.c
|
||||||
setEnvVar YARN_VERSION 0.21.3
|
setEnvVar YARN_VERSION 0.21.3
|
||||||
setEnvVar CHROMIUM_VERSION 433059 # Chrome 53 linux stable, see https://www.chromium.org/developers/calendar
|
setEnvVar CHROMIUM_VERSION 433059 # Chrome 53 linux stable, see https://www.chromium.org/developers/calendar
|
||||||
setEnvVar SAUCE_CONNECT_VERSION 4.3.11
|
setEnvVar SAUCE_CONNECT_VERSION 4.3.11
|
||||||
# TODO(i): this won't work locally
|
setEnvVar PROJECT_ROOT $(cd ${thisDir}/../..; pwd)
|
||||||
setEnvVar PROJECT_ROOT ${TRAVIS_BUILD_DIR} # all source includes above for helper files in this env.sh script (e.g. _travis_fold.sh) duplicate this setting, update those if you change it here
|
|
||||||
|
|
||||||
if [[ ${TRAVIS:-} ]]; then
|
if [[ ${TRAVIS:-} ]]; then
|
||||||
case ${CI_MODE} in
|
case ${CI_MODE} in
|
||||||
|
@ -124,7 +117,4 @@ if [[ ${print} == "print" ]]; then
|
||||||
echo PS4=${PS4}
|
echo PS4=${PS4}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# restore set -x mode
|
eval "${ORIGINAL_SHELL_OPTIONS}"
|
||||||
if [[ wasBashSetXOn == 1 ]]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
|
@ -2,12 +2,18 @@
|
||||||
|
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
cd `dirname $0`
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ./env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
cd ../..
|
|
||||||
|
|
||||||
|
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
||||||
|
# The variable is not set in early stages of the build, so we default to 0 there.
|
||||||
|
# https://docs.travis-ci.com/user/environment-variables/
|
||||||
|
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
mkdir -p ${LOGS_DIR}
|
mkdir -p ${LOGS_DIR}
|
||||||
|
|
||||||
|
@ -43,9 +49,11 @@ fi
|
||||||
if [[ ${TRAVIS} && (${CI_MODE} == "aio" || ${CI_MODE} == "docs_test") ]]; then
|
if [[ ${TRAVIS} && (${CI_MODE} == "aio" || ${CI_MODE} == "docs_test") ]]; then
|
||||||
# angular.io: Install all yarn dependencies according to angular.io/yarn.lock
|
# angular.io: Install all yarn dependencies according to angular.io/yarn.lock
|
||||||
travisFoldStart "yarn-install.aio"
|
travisFoldStart "yarn-install.aio"
|
||||||
cd "`dirname $0`/../../aio"
|
(
|
||||||
yarn install
|
printenv
|
||||||
cd -
|
cd ${PROJECT_ROOT}/aio
|
||||||
|
yarn install
|
||||||
|
)
|
||||||
travisFoldEnd "yarn-install.aio"
|
travisFoldEnd "yarn-install.aio"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -53,7 +61,9 @@ fi
|
||||||
# Install Chromium
|
# Install Chromium
|
||||||
if [[ ${CI_MODE} == "js" || ${CI_MODE} == "e2e" || ${CI_MODE} == "aio" ]]; then
|
if [[ ${CI_MODE} == "js" || ${CI_MODE} == "e2e" || ${CI_MODE} == "aio" ]]; then
|
||||||
travisFoldStart "install-chromium"
|
travisFoldStart "install-chromium"
|
||||||
./scripts/ci/install_chromium.sh
|
(
|
||||||
|
${thisDir}/install-chromium.sh
|
||||||
|
)
|
||||||
travisFoldEnd "install-chromium"
|
travisFoldEnd "install-chromium"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -61,7 +71,9 @@ fi
|
||||||
# Install Sauce Connect
|
# Install Sauce Connect
|
||||||
if [[ ${TRAVIS}] && (${CI_MODE} == "saucelabs_required" || ${CI_MODE} == "saucelabs_optional") ]]; then
|
if [[ ${TRAVIS}] && (${CI_MODE} == "saucelabs_required" || ${CI_MODE} == "saucelabs_optional") ]]; then
|
||||||
travisFoldStart "install-sauceConnect"
|
travisFoldStart "install-sauceConnect"
|
||||||
./scripts/sauce/sauce_connect_setup.sh
|
(
|
||||||
|
${thisDir}/../sauce/sauce_connect_setup.sh
|
||||||
|
)
|
||||||
travisFoldEnd "install-sauceConnect"
|
travisFoldEnd "install-sauceConnect"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -69,7 +81,9 @@ fi
|
||||||
# Install BrowserStack Tunnel
|
# Install BrowserStack Tunnel
|
||||||
if [[ ${TRAVIS} && (${CI_MODE} == "browserstack_required" || ${CI_MODE} == "browserstack_optional") ]]; then
|
if [[ ${TRAVIS} && (${CI_MODE} == "browserstack_required" || ${CI_MODE} == "browserstack_optional") ]]; then
|
||||||
travisFoldStart "install-browserstack"
|
travisFoldStart "install-browserstack"
|
||||||
./scripts/browserstack/start_tunnel.sh
|
(
|
||||||
|
${thisDir}/../browserstack/start_tunnel.sh
|
||||||
|
)
|
||||||
travisFoldEnd "install-browserstack"
|
travisFoldEnd "install-browserstack"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -ex -o pipefail
|
|
||||||
|
set -u -e -o pipefail
|
||||||
|
|
||||||
|
|
||||||
# These ones can be `npm link`ed for fast development
|
# These ones can be `npm link`ed for fast development
|
||||||
LINKABLE_PKGS=(
|
LINKABLE_PKGS=(
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# override test failure so that we perform this file regardless and not abort in env.sh
|
|
||||||
TRAVIS_TEST_RESULT=0
|
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
for FILE in ${LOGS_DIR}/*; do
|
for FILE in ${LOGS_DIR}/*; do
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
set -e -x
|
|
||||||
|
set -u -e -o pipefail
|
||||||
|
|
||||||
|
# Setup environment
|
||||||
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
# Find the most recent tag that is reachable from the current commit.
|
# Find the most recent tag that is reachable from the current commit.
|
||||||
|
|
|
@ -3,36 +3,41 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
cd ${PROJECT_ROOT}/aio
|
|
||||||
|
|
||||||
|
|
||||||
# Lint the code
|
# run in subshell to avoid polluting cwd
|
||||||
travisFoldStart "test.aio.lint"
|
(
|
||||||
yarn run lint
|
cd ${PROJECT_ROOT}/aio
|
||||||
travisFoldEnd "test.aio.lint"
|
|
||||||
|
|
||||||
# Generate docs files
|
|
||||||
# TODO(i): why is this in 'test' phase and not in the 'build' phase?
|
|
||||||
travisFoldStart "test.aio.doc-gen"
|
|
||||||
$(npm bin)/gulp docs
|
|
||||||
travisFoldEnd "test.aio.doc-gen"
|
|
||||||
|
|
||||||
|
|
||||||
# Start xvfb for local Chrome used for testing
|
# Lint the code
|
||||||
if [[ ${TRAVIS} ]]; then
|
travisFoldStart "test.aio.lint"
|
||||||
travisFoldStart "test.aio.xvfb-start"
|
yarn run lint
|
||||||
sh -e /etc/init.d/xvfb start
|
travisFoldEnd "test.aio.lint"
|
||||||
travisFoldEnd "test.aio.xvfb-start"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run unit tests
|
# Generate docs files
|
||||||
travisFoldStart "test.aio.unit"
|
# TODO(i): why is this in 'test' phase and not in the 'build' phase?
|
||||||
yarn test -- --single-run
|
travisFoldStart "test.aio.doc-gen"
|
||||||
travisFoldEnd "test.aio.unit"
|
$(npm bin)/gulp docs
|
||||||
|
travisFoldEnd "test.aio.doc-gen"
|
||||||
|
|
||||||
# Run e2e tests
|
|
||||||
travisFoldStart "test.aio.e2e"
|
# Start xvfb for local Chrome used for testing
|
||||||
yarn run e2e
|
if [[ ${TRAVIS} ]]; then
|
||||||
travisFoldEnd "test.aio.e2e"
|
travisFoldStart "test.aio.xvfb-start"
|
||||||
|
sh -e /etc/init.d/xvfb start
|
||||||
|
travisFoldEnd "test.aio.xvfb-start"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run unit tests
|
||||||
|
travisFoldStart "test.aio.unit"
|
||||||
|
yarn test -- --single-run
|
||||||
|
travisFoldEnd "test.aio.unit"
|
||||||
|
|
||||||
|
# Run e2e tests
|
||||||
|
travisFoldStart "test.aio.e2e"
|
||||||
|
yarn run e2e
|
||||||
|
travisFoldEnd "test.aio.e2e"
|
||||||
|
)
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
travisFoldStart "test.unit.browserstack"
|
travisFoldStart "test.unit.browserstack"
|
||||||
|
|
|
@ -3,11 +3,13 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
travisFoldStart "test.docs"
|
travisFoldStart "test.docs"
|
||||||
cd ${PROJECT_ROOT}/aio
|
(
|
||||||
$(npm bin)/gulp docs-test
|
cd ${PROJECT_ROOT}/aio
|
||||||
|
$(npm bin)/gulp docs-test
|
||||||
|
)
|
||||||
travisFoldEnd "test.docs"
|
travisFoldEnd "test.docs"
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
travisFoldStart "test.e2e.buildPackages"
|
travisFoldStart "test.e2e.buildPackages"
|
||||||
|
@ -26,7 +26,7 @@ travisFoldEnd "test.e2e.integration"
|
||||||
|
|
||||||
travisFoldStart "test.e2e.offlineCompiler"
|
travisFoldStart "test.e2e.offlineCompiler"
|
||||||
#TODO(alexeagle): move offline_compiler_test to integration/
|
#TODO(alexeagle): move offline_compiler_test to integration/
|
||||||
./scripts/ci-lite/offline_compiler_test.sh
|
${thisDir}/offline_compiler_test.sh
|
||||||
travisFoldEnd "test.e2e.offlineCompiler"
|
travisFoldEnd "test.e2e.offlineCompiler"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
# Run unit tests for our tools/ directory
|
# Run unit tests for our tools/ directory
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
travisFoldStart "test.unit.saucelabs"
|
travisFoldStart "test.unit.saucelabs"
|
||||||
|
|
|
@ -3,33 +3,41 @@
|
||||||
set -u -e -o pipefail
|
set -u -e -o pipefail
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
|
# If the previous commands in the `script` section of .travis.yaml failed, then abort.
|
||||||
|
# The variable is not set in early stages of the build, so we default to 0 there.
|
||||||
|
# https://docs.travis-ci.com/user/environment-variables/
|
||||||
|
if [[ ${TRAVIS_TEST_RESULT=0} == 1 ]]; then
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
case ${CI_MODE} in
|
case ${CI_MODE} in
|
||||||
js)
|
js)
|
||||||
./scripts/ci-lite/test_js.sh
|
${thisDir}/test-js.sh
|
||||||
;;
|
;;
|
||||||
e2e)
|
e2e)
|
||||||
./scripts/ci-lite/test_e2e.sh
|
${thisDir}/test-e2e.sh
|
||||||
;;
|
;;
|
||||||
saucelabs_required)
|
saucelabs_required)
|
||||||
./scripts/ci-lite/test_saucelabs.sh
|
${thisDir}/test-saucelabs.sh
|
||||||
;;
|
;;
|
||||||
browserstack_required)
|
browserstack_required)
|
||||||
./scripts/ci-lite/test_browserstack.sh
|
${thisDir}/test-browserstack.sh
|
||||||
;;
|
;;
|
||||||
saucelabs_optional)
|
saucelabs_optional)
|
||||||
./scripts/ci-lite/test_saucelabs.sh
|
${thisDir}/test-saucelabs.sh
|
||||||
;;
|
;;
|
||||||
browserstack_optional)
|
browserstack_optional)
|
||||||
./scripts/ci-lite/test_browserstack.sh
|
${thisDir}/test-browserstack.sh
|
||||||
;;
|
;;
|
||||||
docs_test)
|
docs_test)
|
||||||
./scripts/ci-lite/test_docs.sh
|
${thisDir}/test-docs.sh
|
||||||
;;
|
;;
|
||||||
aio)
|
aio)
|
||||||
./scripts/ci-lite/test_aio.sh
|
${thisDir}/test-aio.sh
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
set +x -u -e -o pipefail
|
set +x -u -e -o pipefail
|
||||||
|
|
||||||
|
|
||||||
# Setup environment
|
# Setup environment
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/_travis_fold.sh
|
readonly thisDir=$(cd $(dirname $0); pwd)
|
||||||
source ${TRAVIS_BUILD_DIR}/scripts/ci-lite/env.sh
|
source ${thisDir}/../ci/_travis-fold.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue