forked from pypa/virtualenv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
156 lines (140 loc) · 4.69 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
variables:
"System.PreferGit": true
PYTEST_ADDOPTS: "-vv -ra --showlocals"
CI_RUN: "yes"
trigger:
batch: true
branches:
include:
- master
- refs/tags/*
paths:
exclude:
- LICENSE.txt
- HOWTORELEASE.rst
- AUTHORS.txt
- CONTRIBUTING.rst
- .gitignore
- .github/*
jobs:
- template: azure-run-tox-env.yml
parameters: {tox: fix_lint, python: 3.7}
- template: azure-run-tox-env.yml
parameters: {tox: embed, python: 3.7}
- template: azure-run-tox-env.yml
parameters: {tox: docs, python: 3.7}
- template: azure-run-tox-env.yml
parameters: {tox: package_readme, python: 3.7}
- template: azure-run-tox-env.yml
parameters: {tox: jython, python: 3.7, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: pypy, python: pypy, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: pypy3, python: pypy3, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: py37, python: 3.7, os: windows}
- template: azure-run-tox-env.yml
parameters: {tox: py36, python: 3.6, os: windows}
- template: azure-run-tox-env.yml
parameters: {tox: py35, python: 3.5, os: windows}
- template: azure-run-tox-env.yml
parameters: {tox: py34, python: 3.4, os: windows}
- template: azure-run-tox-env.yml
parameters: {tox: py27, python: 2.7, os: windows}
- template: azure-run-tox-env.yml
parameters: {tox: py37, python: 3.7, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: py36, python: 3.6, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: py35, python: 3.5, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: py34, python: 3.4, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: py27, python: 2.7, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: py36, python: 3.6, os: macOs}
- template: azure-run-tox-env.yml
parameters: {tox: py27, python: 2.7, os: macOs}
- template: azure-run-tox-env.yml
parameters: {tox: cross_python2, python: 3.7, os: linux}
- template: azure-run-tox-env.yml
parameters: {tox: cross_python3, python: 3.7, os: linux}
- job: report_coverage
pool: {vmImage: 'Ubuntu 16.04'}
dependsOn:
- windows_py37
- windows_py36
- windows_py35
- windows_py34
- windows_py27
- linux_py37
- linux_py36
- linux_py35
- linux_py34
- linux_py27
- linux_pypy3
- linux_pypy
- linux_jython
- macOS_py36
- macOS_py27
steps:
- task: DownloadBuildArtifacts@0
displayName: download coverage files for run
inputs:
buildType: current
downloadType: specific
itemPattern: coverage-*/*
downloadPath: $(Build.StagingDirectory)
- task: UsePythonVersion@0
displayName: setup python
inputs:
versionSpec: 3.7
- script: |
python -c '
from pathlib import Path
import shutil
from_folder = Path("$(Build.StagingDirectory)")
destination_folder = Path("$(System.DefaultWorkingDirectory)") / ".tox"
destination_folder.mkdir()
for coverage_file in from_folder.glob("*/.coverage"):
destination = destination_folder / f".coverage.{coverage_file.parent.name[9:]}"
print(f"{coverage_file} copy to {destination}")
shutil.copy(str(coverage_file), str(destination))'
displayName: move coverage files into .tox
- script: 'python -m pip install -U tox --pre'
displayName: install tox
- script: 'python -m tox -e coverage'
displayName: create coverag report via tox
- task: PublishCodeCoverageResults@1
displayName: publish overall coverage report to Azure
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/.tox/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/.tox/htmlcov'
failIfCoverageEmpty: true
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
- job: publish
dependsOn:
- report_coverage
- linux_fix_lint
- linux_docs
- linux_embed
- linux_package_readme
condition: succeeded()
pool: {vmImage: 'Ubuntu 16.04'}
steps:
- task: UsePythonVersion@0
displayName: setup python3.7
inputs: {versionSpec: '3.7'}
- task: TwineAuthenticate@0
inputs:
externalFeeds: 'gb'
- script: 'python3.7 -m pip install -U twine pip tox'
displayName: "acquire build tools"
- script: 'python3.7 -m pip wheel -w "$(System.DefaultWorkingDirectory)/w" --no-deps .'
displayName: "build wheel"
- script: 'python3.7 -m tox -e py --sdistonly'
displayName: "build sdist"
- script: 'python3.7 -m twine upload -r pypi-gb --config-file $(PYPIRC_PATH) .tox/dist/* $(System.DefaultWorkingDirectory)/w/*'
displayName: "upload sdist and wheel to PyPi"