mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build(ci): skip tests on CI when only markdown files have changed (#4452)
Skip e2e and unit tests for Push/PR build
This commit is contained in:
committed by
tinayuangao
parent
13524c14d1
commit
aee42aebb7
@@ -10,6 +10,19 @@ cd $(dirname $0)/../..
|
||||
source scripts/ci/sources/mode.sh
|
||||
source scripts/ci/sources/tunnel.sh
|
||||
|
||||
# Get commit diff
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
|
||||
fileDiff=$(git diff --name-only $TRAVIS_COMMIT_RANGE)
|
||||
else
|
||||
fileDiff=$(git diff --name-only $TRAVIS_BRANCH...HEAD)
|
||||
fi
|
||||
|
||||
# Check if tests can be skipped
|
||||
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]] && (is_e2e || is_unit); then
|
||||
echo "Skipping e2e and unit tests since only markdown files changed"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
start_tunnel
|
||||
wait_for_tunnel
|
||||
|
||||
@@ -23,7 +36,7 @@ elif is_payload; then
|
||||
$(npm bin)/gulp ci:payload
|
||||
elif is_closure_compiler; then
|
||||
./scripts/closure-compiler/build-devapp-bundle.sh
|
||||
else
|
||||
elif is_unit; then
|
||||
$(npm bin)/gulp ci:test
|
||||
fi
|
||||
|
||||
|
||||
@@ -19,4 +19,8 @@ is_closure_compiler() {
|
||||
|
||||
is_payload() {
|
||||
[[ "$MODE" = payload ]]
|
||||
}
|
||||
}
|
||||
|
||||
is_unit() {
|
||||
[[ "$MODE" = saucelabs_required || "$MODE" = browserstack_required ]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user