diff --git a/.travis.yml b/.travis.yml index cfcdb600fa94..dc3f4e01dfe6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ env: # Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete. - MODE=lint - MODE=circular_deps + - MODE=extract_metadata - MODE=e2e - MODE=saucelabs_required - MODE=browserstack_required diff --git a/scripts/ci/build-and-test.sh b/scripts/ci/build-and-test.sh index 63bf34127a6d..969cba5a68ed 100755 --- a/scripts/ci/build-and-test.sh +++ b/scripts/ci/build-and-test.sh @@ -11,8 +11,6 @@ source scripts/ci/sources/mode.sh source scripts/ci/sources/tunnel.sh start_tunnel -npm run build -npm run inline-resources wait_for_tunnel if is_lint; then @@ -20,6 +18,8 @@ if is_lint; then npm run ci:forbidden-identifiers npm run stylelint elif is_circular_deps_check; then + # Build first because madge needs the JavaScript output. + ng build npm run check-circular-deps elif is_e2e; then # Start up the e2e app. This will take some time. @@ -32,12 +32,24 @@ elif is_e2e; then echo "Waiting for e2e app to start" while [ ! -f ./dist/components/button/button.js ]; do sleep 2 + echo -n ".." done + echo "\nInlining resources" + npm run inline-resources + # Run the e2e tests on the served e2e app. echo "Starting e2e tests" ng e2e +elif is_extract_metadata; then + # Run `tsc` first so that the directory structure in dist/ matches what ngc expects. + ./node_modules/.bin/tsc -p ./src/demo-app/ + ./node_modules/.bin/ngc -p ./src/demo-app/ else + # Unit tests + npm run build + npm run inline-resources + karma start test/karma.conf.js --single-run --no-auto-watch --reporters='dots' fi teardown_tunnel diff --git a/scripts/ci/sources/mode.sh b/scripts/ci/sources/mode.sh index ce2dd1c5c3ec..a6903ccf3d7f 100644 --- a/scripts/ci/sources/mode.sh +++ b/scripts/ci/sources/mode.sh @@ -12,3 +12,7 @@ is_lint() { is_circular_deps_check() { [[ "$MODE" = circular_deps ]] } + +is_extract_metadata() { + [[ "$MODE" = extract_metadata ]] +}