-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.azure-pipelines.yml
147 lines (144 loc) · 5.2 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
trigger:
branches:
include:
- '*'
tags:
include:
- 'v*'
strategy:
matrix:
MacOs CPython3.5:
image: 'macos-10.14'
python.version: '3.5'
python.architecture: 'x64'
MacOs CPython3.6:
image: 'macos-10.14'
python.version: '3.6'
python.architecture: 'x64'
MacOs CPython3.7:
image: 'macos-10.14'
python.version: '3.7'
python.architecture: 'x64'
MacOs CPython3.8:
image: 'macos-10.14'
python.version: '3.8'
python.architecture: 'x64'
MacOs CPython3.9:
image: 'macos-10.14'
python.version: '3.9'
python.architecture: 'x64'
Ubuntu CPython3.5:
image: 'ubuntu-latest'
python.version: '3.5'
python.architecture: 'x64'
Ubuntu CPython3.6:
image: 'ubuntu-latest'
python.version: '3.6'
python.architecture: 'x64'
Ubuntu CPython3.7:
image: 'ubuntu-latest'
python.version: '3.7'
python.architecture: 'x64'
Ubuntu CPython3.8:
image: 'ubuntu-latest'
python.version: '3.8'
python.architecture: 'x64'
Ubuntu CPython3.9:
image: 'ubuntu-latest'
python.version: '3.9'
python.architecture: 'x64'
Windows CPython3.5 (x86):
image: 'windows-latest'
python.version: '3.5'
python.architecture: 'x86'
Windows CPython3.5 (x64):
image: 'windows-latest'
python.version: '3.5'
python.architecture: 'x64'
Windows CPython3.6 (x86):
image: 'windows-latest'
python.version: '3.6'
python.architecture: 'x86'
Windows CPython3.6 (x64):
image: 'windows-latest'
python.version: '3.6'
python.architecture: 'x64'
Windows CPython3.7 (x86):
image: 'windows-latest'
python.version: '3.7'
python.architecture: 'x86'
Windows CPython3.7 (x64):
image: 'windows-latest'
python.version: '3.7'
python.architecture: 'x64'
Windows CPython3.8 (x86):
image: 'windows-latest'
python.version: '3.8'
python.architecture: 'x86'
Windows CPython3.8 (x64):
image: 'windows-latest'
python.version: '3.8'
python.architecture: 'x64'
Windows CPython3.9 (x86):
image: 'windows-latest'
python.version: '3.9'
python.architecture: 'x86'
Windows CPython3.9 (x64):
image: 'windows-latest'
python.version: '3.9'
python.architecture: 'x64'
pool:
vmImage: $(image)
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: '$(python.architecture)'
- bash: python -m pip install --upgrade pip setuptools
displayName: 'Install packaging tools'
- bash: python setup.py develop
displayName: 'Install in editable mode'
env:
CPPFLAGS: --coverage -O0
- bash: python -m pip install --upgrade codecov
displayName: 'Install coverage dependencies'
- bash: python -m doctest README.md
displayName: 'Run doctests'
- bash: python -m pip install -r requirements-tests.txt
displayName: 'Install tests dependencies'
- bash: pytest
displayName: 'Run tests'
- bash: python -m pip install --upgrade gcovr
condition: and(succeeded(), startsWith(variables['python.version'], '3.'))
displayName: 'Install С++ coverage dependencies'
- bash: gcovr --filter src/ --filter include/ --xml -o coverage_cpp.xml
condition: and(succeeded(), startsWith(variables['python.version'], '3.'))
displayName: 'Collect C++ coverage'
- bash: python -m codecov -f coverage_cpp.xml -X gcov --build "$AGENT_JOBNAME"
condition: and(succeeded(), startsWith(variables['python.version'], '3.'))
displayName: 'Upload C++ coverage'
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
- bash: python -m pip install --upgrade cibuildwheel
condition: and(succeeded(), startsWith(variables['python.version'], '3.'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Install build dependencies'
- bash: rm -rf build && rm -f $(python -c 'from importlib.machinery import EXTENSION_SUFFIXES; print(" ".join("*" + suffix for suffix in EXTENSION_SUFFIXES))')
condition: and(succeeded(), startsWith(variables['python.version'], '3.'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Pre-build'
- bash: python setup.py sdist
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Build source distribution'
- bash:
CIBW_BUILD=$(python -c 'import sys; print("cp" + "".join(map(str, sys.version_info[:2])) + "-*")')
cibuildwheel --output-dir dist
condition: and(succeeded(), startsWith(variables['python.version'], '3.'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Build wheels'
- bash: python -m pip install --upgrade twine
condition: and(succeeded(), startsWith(variables['python.version'], '3.'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Install deploy dependencies'
- bash: twine upload --skip-existing dist/*
condition: and(succeeded(), startsWith(variables['python.version'], '3.'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Deploy'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: $(TWINE_PASSWORD)