]> granicus.if.org Git - python/commitdiff
[3.6] Add short-circuit for doc changes to AppVeyor (GH-5628)
authorZachary Ware <zachary.ware@gmail.com>
Sun, 11 Feb 2018 19:56:57 +0000 (13:56 -0600)
committerGitHub <noreply@github.com>
Sun, 11 Feb 2018 19:56:57 +0000 (13:56 -0600)
(cherry picked from commit 28607e0dd9417ce44a109980ffd60697c1afdea0)

.github/appveyor.yml

index 162a7d8a701cbde72f13138f242d8c90737a68f2..6e6a078a10326772422ec15b191b999e38a58ef9 100644 (file)
@@ -7,13 +7,29 @@ branches:
     - buildbot-custom
 cache:
   - externals -> PCbuild\*
+before_build:
+  - ps: |+
+      if ($env:APPVEYOR_RE_BUILD) {
+        echo 'Doing full build due to re-build request.'
+      } elseif (!$env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) {
+        echo 'Not a PR, doing full build.'
+      } else {
+        $mergebase = git merge-base $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT $env:APPVEYOR_REPO_BRANCH
+        $changes = git diff --name-only HEAD $mergebase | grep -vE '(\.rst$)|(^Doc)|(^Misc)'
+        If (!$changes) {
+          echo 'Only docs were updated, stopping build process.'
+          Exit-AppveyorBuild
+        }
+      }
+
+
 build_script:
-- cmd: PCbuild\build.bat -e
-- cmd: PCbuild\win32\python.exe -m test.pythoninfo
+  - cmd: PCbuild\build.bat -e
+  - cmd: PCbuild\win32\python.exe -m test.pythoninfo
 test_script:
-- cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
+  - cmd: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0
 environment:
   HOST_PYTHON: C:\Python36\python.exe
 image:
-- Visual Studio 2015
-- Visual Studio 2017
+  - Visual Studio 2015
+  - Visual Studio 2017