mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
a02e6c64f1
* Since we going to move from Travis to CircleCI we don't want to use the dashboard anymore. Since nobody has been looking at the dashboard frequently, it just makes things more complicated and additionally we will be using the Github robot in order to keep track of size changes.
49 lines
1.2 KiB
Bash
Executable File
49 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script that runs in the testing build stage of Travis and is responsible for testing
|
|
# the project in different Travis jobs of the current build stage.
|
|
|
|
# The script should immediately exit if any command in the script fails.
|
|
set -e
|
|
|
|
echo ""
|
|
echo "Building sources and running tests. Running mode: ${MODE}"
|
|
echo ""
|
|
|
|
# Go to project dir
|
|
cd $(dirname $0)/../..
|
|
|
|
# Include sources.
|
|
source scripts/ci/sources/mode.sh
|
|
source scripts/ci/sources/tunnel.sh
|
|
|
|
# Get the commit diff and skip the build if only .md files have changed.
|
|
# Should not apply to master builds.
|
|
if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
|
|
fileDiff=$(git diff --name-only $TRAVIS_BRANCH...HEAD)
|
|
|
|
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then
|
|
echo "Skipping tests because only markdown files changed."
|
|
exit 0
|
|
fi
|
|
fi
|
|
|
|
start_tunnel
|
|
wait_for_tunnel
|
|
|
|
if is_lint; then
|
|
$(npm bin)/gulp ci:lint
|
|
elif is_e2e; then
|
|
# Run e2e tests inside of Xvfb because we need to test the HTML Fullscreen API's that cannot
|
|
# be tested within Chrome headless.
|
|
xvfb-run -a --server-args='-screen 0, 1024x768x16' $(npm bin)/gulp ci:e2e
|
|
elif is_aot; then
|
|
$(npm bin)/gulp ci:aot
|
|
elif is_unit; then
|
|
$(npm bin)/gulp ci:test
|
|
elif is_prerender; then
|
|
$(npm bin)/gulp ci:prerender
|
|
fi
|
|
|
|
teardown_tunnel
|