bpo-35683: Improve Azure Pipelines steps (GH-11493) · python/cpython@128efca
11parameters:
22coverage: false
3+sudo_dependencies: sudo
4+dependencies: apt
5+patchcheck: true
6+xvfb: true
3748steps:
59- checkout: self
610clean: true
711fetchDepth: 5
8129-- script: ./.azure-pipelines/posix-deps.sh $(openssl_version)
13+- script: ${{ parameters.sudo_dependencies }} ./.azure-pipelines/posix-deps-${{ parameters.dependencies }}.sh $(openssl_version)
1014displayName: 'Install dependencies'
11151216- script: ./configure --with-pydebug
@@ -23,7 +27,7 @@ steps:
2327displayName: 'Display build info'
24282529 - script: |
26- xvfb-run ./venv/bin/python -m coverage run --pylib -m test \
30+ $COMMAND -m coverage run --pylib -m test \
2731 --fail-env-changed \
2832 -uall,-cpu \
2933 --junit-xml=$(build.binariesDirectory)/test-results.xml" \
@@ -32,6 +36,11 @@ steps:
3236 -x test_multiprocessing_spawn \
3337 -x test_concurrent_futures
3438 displayName: 'Tests with coverage'
39+ env:
40+ ${{ if eq(parameters.xvfb, 'true') }}:
41+ COMMAND: xvfb-run ./venv/bin/python
42+ ${{ if ne(parameters.xvfb, 'true') }}:
43+ COMMAND: ./venv/bin/python
35443645 - script: ./venv/bin/python -m coverage xml
3746displayName: 'Generate coverage.xml'
@@ -44,13 +53,18 @@ steps:
4453 - script: make pythoninfo
4554displayName: 'Display build info'
465547- - script: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
56+ - script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
4857displayName: 'Tests'
49-50-51-- script: ./python Tools/scripts/patchcheck.py --travis true
52-displayName: 'Run patchcheck.py'
53-condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
58+env:
59+${{ if eq(parameters.xvfb, 'true') }}:
60+COMMAND: xvfb-run make
61+${{ if ne(parameters.xvfb, 'true') }}:
62+COMMAND: make
63+64+- ${{ if eq(parameters.patchcheck, 'true') }}:
65+ - script: ./python Tools/scripts/patchcheck.py --travis true
66+displayName: 'Run patchcheck.py'
67+condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
546855695670- task: PublishTestResults@2