Jelajahi Sumber

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 d2f9e2868304729bbd63ca4900485ac5d49b5410)
Marian Beermann 7 tahun lalu
induk
melakukan
f948cfbe35
1 mengubah file dengan 6 tambahan dan 3 penghapusan
  1. 6 3
      .travis.yml

+ 6 - 3
.travis.yml

@@ -39,9 +39,12 @@ matrix:
 
 before_install:
 - |
-    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: