@@ -27,12 +27,24 @@ steps:
2727 clean : true
2828 fetchDepth : 5
2929
30+ - script : |
31+ git fetch -q origin $(system.pullRequest.targetBranch)
32+ if ! git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD) | grep -qvE '(\.rst$|^Doc|^Misc)'
33+ then
34+ echo "Only docs were updated, stopping build process."
35+ echo "##vso[task.setvariable variable=DocOnly]true"
36+ exit
37+ fi
38+ displayName : Detect doc-only changes
39+ condition : and(succeeded(), variables['system.pullRequest.targetBranch'])
40+
3041# - template: linux-deps.yml
3142
3243# See https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted-templates.md
3344# For now, we copy/paste the steps
3445- script : echo "deb-src http://archive.ubuntu.com/ubuntu/ xenial main" > /etc/apt/sources.list.d/python.list && sudo apt-get update
3546 displayName : ' Update apt-get lists'
47+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
3648
3749- script : echo # #vso[task.prependpath]$(OPENSSL_DIR)
3850 displayName : ' Add $(OPENSSL_DIR) to PATH'
@@ -55,24 +67,32 @@ steps:
5567 uuid-dev
5668 xvfb
5769 displayName : ' Install dependencies'
70+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
5871- script : python3 Tools/ssl/multissltests.py --steps=library --base-directory $(build.sourcesDirectory)/multissl --openssl $(OPENSSL) --system Linux
5972 displayName : ' python multissltests.py'
73+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
6074
6175
6276- script : ./configure --with-pydebug
6377 displayName : ' Configure CPython (debug)'
78+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
6479
6580- script : make -s -j4
6681 displayName : ' Build CPython'
82+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
6783
6884- script : ./python -m venv venv && ./venv/bin/python -m pip install -U coverage
6985 displayName : ' Set up virtual environment'
86+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
7087
7188- script : ./venv/bin/python -m test.pythoninfo
7289 displayName : ' Display build info'
90+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
7391
7492- script : xvfb-run ./venv/bin/python -m coverage run --pylib -m test --fail-env-changed -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn -x test_concurrent_futures
7593 displayName : ' Tests with coverage'
94+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
7695
7796- script : source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash)
7897 displayName : ' Publish code coverage results'
98+ condition : and(succeeded(), ne(variables['DocOnly'], 'true'))
0 commit comments