chore(build): split Dart and JS builds

This commit is contained in:
Yegor Jbanov 2015-02-13 14:59:29 -08:00
parent 8f6c45f9e2
commit 6197ab0e48
9 changed files with 75 additions and 14 deletions

View File

@ -9,21 +9,20 @@ env:
- LOGS_DIR=/tmp/angular-build/logs
- ARCH=linux-x64
matrix:
- CHANNEL=stable
- CHANNEL=dev
- MODE=js DART_CHANNEL=stable
- MODE=dart DART_CHANNEL=stable
- MODE=dart DART_CHANNEL=dev
before_install:
- export DISPLAY=:99.0
- export GIT_SHA=$(git rev-parse HEAD)
- ./scripts/ci/init_android.sh
- ./scripts/ci/install_dart.sh
- ./scripts/ci/install_dart.sh ${DART_CHANNEL} ${ARCH}
- sh -e /etc/init.d/xvfb start
- if [[ -e SKIP_TRAVIS_TESTS ]]; then { cat SKIP_TRAVIS_TESTS ; exit 0; } fi
before_script:
- mkdir -p $LOGS_DIR
script:
- ./scripts/ci/build.sh
- ./scripts/ci/test_unit.sh
- ./scripts/ci/test_e2e.sh
- ./scripts/ci/build_and_test.sh ${MODE}
after_script:
- ./scripts/ci/print-logs.sh

13
scripts/ci/build_and_test.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e
MODE=$1
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
cd $SCRIPT_DIR/../..
${SCRIPT_DIR}/build_$MODE.sh
${SCRIPT_DIR}/test_unit_$MODE.sh
${SCRIPT_DIR}/test_e2e_$MODE.sh

View File

@ -7,6 +7,6 @@ SCRIPT_DIR=$(dirname $0)
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/gulp build
./node_modules/.bin/gulp build.js.cjs build.dart
pub install

View File

@ -4,7 +4,8 @@ set -e
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
# this is needed because we're running JS tests in Dartium too
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/gulp ci --browsers=$KARMA_BROWSERS
./node_modules/.bin/gulp build.js

View File

@ -1,13 +1,16 @@
#!/bin/bash
set -e
set -e -x
AVAILABLE_DART_VERSION=$(curl "https://storage.googleapis.com/dart-archive/channels/$CHANNEL/release/latest/VERSION" | python -c \
DART_CHANNEL=$1
ARCH=$2
AVAILABLE_DART_VERSION=$(curl "https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/latest/VERSION" | python -c \
'import sys, json; print(json.loads(sys.stdin.read())["version"])')
echo Fetch Dart channel: $CHANNEL
echo Fetch Dart channel: ${DART_CHANNEL}
URL_PREFIX=https://storage.googleapis.com/dart-archive/channels/$CHANNEL/release/latest
URL_PREFIX=https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/latest
DART_SDK_URL="$URL_PREFIX/sdk/dartsdk-$ARCH-release.zip"
DARTIUM_URL="$URL_PREFIX/dartium/dartium-$ARCH-release.zip"

View File

@ -13,7 +13,7 @@ function killServer () {
kill $serverPid
}
./node_modules/.bin/gulp serve.js.prod serve.js.dart2js&
./node_modules/.bin/gulp serve.js.dart2js&
serverPid=$!
trap killServer EXIT
@ -21,5 +21,4 @@ trap killServer EXIT
# wait for server to come up!
sleep 10
./node_modules/.bin/protractor protractor-e2e-js.conf.js --browsers=$E2E_BROWSERS
./node_modules/.bin/protractor protractor-e2e-dart2js.conf.js --browsers=$E2E_BROWSERS

24
scripts/ci/test_e2e_js.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/webdriver-manager update
function killServer () {
kill $serverPid
}
./node_modules/.bin/gulp serve.js.prod&
serverPid=$!
trap killServer EXIT
# wait for server to come up!
sleep 10
./node_modules/.bin/protractor protractor-e2e-js.conf.js --browsers=$E2E_BROWSERS

11
scripts/ci/test_unit_dart.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/gulp test.transpiler.unittest
./node_modules/.bin/gulp test.dart/ci --browsers=$KARMA_BROWSERS

11
scripts/ci/test_unit_js.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/gulp test.transpiler.unittest
./node_modules/.bin/gulp test.js/ci --browsers=$KARMA_BROWSERS