Browse Source

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.
Marian Beermann 7 năm trước cách đây
mục cha
commit
920d974b25
1 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 6 4
      .travis.yml

+ 6 - 4
.travis.yml

@@ -35,10 +35,12 @@ matrix:
 
 before_install:
 - |
-    echo Checking whether $TRAVIS_COMMIT_RANGE changed only docs
-    git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(AUTHORS|README\.rst|^(docs)/)' || {
-      echo "Only docs were updated, stopping build process."
-      exit
+    test $TRAVIS_EVENT_TYPE != "pull_request" || {
+        echo Checking whether $TRAVIS_COMMIT_RANGE changed only 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."
+            exit
+        }
     }
 
 install: