summaryrefslogtreecommitdiffstats
path: root/.vsts/docs.yml
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2018-08-07 14:45:27 (GMT)
committerGitHub <noreply@github.com>2018-08-07 14:45:27 (GMT)
commitb221c93d4cf8fe9ecec429b08612abcc211a39a6 (patch)
tree7213ca9f0941e3807163a5c6a089dc66ae0c3cbf /.vsts/docs.yml
parent8b58468032b8f87993a121c2b43f52648382a529 (diff)
downloadcpython-b221c93d4cf8fe9ecec429b08612abcc211a39a6.zip
cpython-b221c93d4cf8fe9ecec429b08612abcc211a39a6.tar.gz
cpython-b221c93d4cf8fe9ecec429b08612abcc211a39a6.tar.bz2
VSTS: Skip build steps when only docs have changed (GH-8546)
Diffstat (limited to '.vsts/docs.yml')
-rw-r--r--.vsts/docs.yml16
1 files changed, 15 insertions, 1 deletions
diff --git a/.vsts/docs.yml b/.vsts/docs.yml
index 62f6123..93a7282 100644
--- a/.vsts/docs.yml
+++ b/.vsts/docs.yml
@@ -23,21 +23,35 @@ steps:
clean: true
fetchDepth: 5
+- script: |
+ git fetch -q origin $(system.pullRequest.targetBranch)
+ if ! git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD) | grep -qE '(\.rst$|^Doc|^Misc)'
+ then
+ echo "No docs were updated, stopping build process."
+ echo "##vso[task.setvariable variable=NoDocs]true"
+ exit
+ fi
+ displayName: Detect doc-only changes
+ condition: and(succeeded(), variables['system.pullRequest.targetBranch'])
+
- task: UsePythonVersion@0
displayName: 'Use Python 3.6 or later'
inputs:
versionSpec: '>=3.6'
+ condition: and(succeeded(), ne(variables['NoDocs'], 'true'))
- script: python -m pip install sphinx~=1.6.1 blurb python-docs-theme
displayName: 'Install build dependencies'
+ condition: and(succeeded(), ne(variables['NoDocs'], 'true'))
- script: make check suspicious html PYTHON=python
workingDirectory: '$(build.sourcesDirectory)/Doc'
displayName: 'Build documentation'
+ condition: and(succeeded(), ne(variables['NoDocs'], 'true'))
- task: PublishBuildArtifacts@1
displayName: 'Publish build'
- condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
+ condition: and(and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')), ne(variables['NoDocs'], 'true'))
inputs:
PathToPublish: '$(build.sourcesDirectory)/Doc/build'
ArtifactName: build