travis: only short-circuit docs-only changes for pull requests

if a branch build is stopped, then codecov will complain about
missing base branch coverage.

(cherry picked from commit 920d974b25)
This commit is contained in:
Marian Beermann 2017-08-24 16:24:44 +02:00 committed by Thomas Waldmann
parent 818e5c8e01
commit d2f9e28683
1 changed files with 6 additions and 4 deletions

View File

@ -44,11 +44,13 @@ matrix:
before_install: before_install:
- | - |
test $TRAVIS_EVENT_TYPE != "pull_request" || {
echo Checking whether $TRAVIS_COMMIT_RANGE changed only docs echo Checking whether $TRAVIS_COMMIT_RANGE changed only docs
git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(AUTHORS|README\.rst|^(docs)/)' || { git diff --name-only $TRAVIS_COMMIT_RANGE | grep --quiet --invert-match --extended-regexp '(AUTHORS|README\.rst|^(docs)/)' || {
echo "Only docs were updated, stopping build process." echo "Only docs were updated, stopping build process."
exit exit
} }
}
install: install:
- git fetch --unshallow --tags - git fetch --unshallow --tags