-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
275 lines (265 loc) · 8.04 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
jobs:
- job: 'TestLinuxWheelNoCuda'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python311-Linux:
python.version: '3.12'
maxParallel: 3
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: sudo apt-get update
displayName: 'AptGet Update'
- script: sudo apt-get install -y graphviz
displayName: 'Install Graphviz'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: pip install -r requirements.txt
displayName: 'Install Requirements'
- script: pip install -r requirements-dev.txt
displayName: 'Install Requirements dev'
- script: |
ruff check .
displayName: 'Ruff'
- script: |
black --diff .
displayName: 'Black'
- script: |
cmake-lint _cmake/Find* --disabled-codes C0103 C0113 --line-width=88
cmake-lint _cmake/CMake* --disabled-codes C0103 C0113 --line-width=88
displayName: 'cmake-lint'
- script: |
rstcheck -r ./_doc ./onnx_extended
displayName: 'rstcheck'
- script: |
cython-lint .
displayName: 'cython-lint'
- script: |
export USE_CUDA=0
python -m pip install -e . -v
displayName: 'pip install -e . -v'
- script: |
python -m pytest _unittests --durations=10
displayName: 'Runs Unit Tests'
- script: |
# --config-settings does not work yet.
# python -m pip wheel . --config-settings="--use_cuda=0" -v
# python -m pip wheel . --global-option "--use_cuda=0" -v
export USE_CUDA=0
python -m pip wheel . -v
displayName: 'build wheel'
- script: |
mkdir dist
cp onnx_extended*.whl dist
displayName: 'copy wheel'
- script: |
pip install auditwheel-symbols
auditwheel-symbols --manylinux 2014 dist/*.whl || exit 0
displayName: 'Audit wheel'
- script: |
pip install abi3audit
abi3audit dist/*.whl || exit 0
displayName: 'abi3audit wheel'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel-linux-pip-$(python.version)'
targetPath: 'dist'
- job: 'TestLinux'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python311-Linux:
python.version: '3.10'
maxParallel: 3
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: sudo apt-get update
displayName: 'AptGet Update'
# - script: sudo apt-get install -y pandoc
# displayName: 'Install Pandoc'
# - script: sudo apt-get install -y inkscape
# displayName: 'Install Inkscape'
- script: sudo apt-get install -y graphviz
displayName: 'Install Graphviz'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: pip install -r requirements.txt
displayName: 'Install Requirements'
- script: pip install -r requirements-dev.txt
displayName: 'Install Requirements dev'
- script: |
ruff check .
displayName: 'Ruff'
- script: |
black --diff .
displayName: 'Black'
- script: |
cmake-lint _cmake/Find* --disabled-codes C0103 C0113 --line-width=88
cmake-lint _cmake/CMake* --disabled-codes C0103 C0113 --line-width=88
displayName: 'cmake-lint'
- script: |
cython-lint .
displayName: 'cython-lint'
- script: |
# python -m pip install -e .
python setup.py build_ext --inplace
displayName: 'build inplace'
- bash: |
contents=$(cat .build_path.txt)
export BUILD_PATH="$contents"
cd $BUILD_PATH
ctest --rerun-failed --output-on-failure
displayName: 'Run C++ Unit Tests'
- script: |
python -m pytest _unittests --durations=10
displayName: 'Runs Unit Tests'
- script: |
python -u setup.py bdist_wheel
displayName: 'Build Package'
- script: |
pip install auditwheel-symbols
auditwheel-symbols --manylinux 2014 dist/*.whl || exit 0
displayName: 'Audit wheel'
- script: |
pip install abi3audit
abi3audit dist/*.whl || exit 0
displayName: 'abi3audit wheel'
- script: |
ls dist/*
find dist -type f \( -name "onnx_extended*.whl" \) | while read f; do
echo "pip install $f";
python -m pip install $f;
done
displayName: 'install built wheel'
- script: |
cd dist
python -m pytest ../_unittests
displayName: 'check unit test with the whl'
- script: |
ls -l
displayName: 'current folder'
- script: |
python -c "import onnx_extended;print('has_cuda:',onnx_extended.has_cuda())"
displayName: 'has_cuda?'
- script: |
cp LICENSE* ./_doc
cp CHANGELOGS* ./_doc
displayName: 'Copy license, changelogs'
- script: |
python -m sphinx _doc dist/html -v
displayName: 'Builds Documentation'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel-linux-$(python.version)'
targetPath: 'dist'
- job: 'TestWindows'
pool:
vmImage: 'windows-latest'
strategy:
matrix:
Python311-Windows:
python.version: '3.11'
maxParallel: 3
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: |
pip install -r requirements.txt
displayName: 'Install Requirements'
- script: |
pip install -r requirements-dev.txt
displayName: 'Install Requirements dev'
- script: set
displayName: 'set'
- script: |
python setup.py build_ext --inplace
displayName: 'build'
- script: |
python setup.py install
displayName: 'build wheel'
- powershell: |
$contents = Get-Content -Path ".build_path.txt"
cd $contents
ctest -C Release --rerun-failed --output-on-failure
displayName: 'Runs C++ Unit Tests'
- script: |
python -m pytest _unittests --durations=10 -v
displayName: 'Runs Unit Tests'
- script: |
python -u setup.py bdist_wheel
displayName: 'Build Package'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel-windows-$(python.version)'
targetPath: 'dist'
- job: 'TestMac'
pool:
vmImage: 'macOS-latest'
strategy:
matrix:
Python311-Mac:
python.version: '3.11'
maxParallel: 3
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
# use anaconda
# - bash: echo "##vso[task.prependpath]$CONDA/bin"
# displayName: Add conda to PATH
# - bash: sudo chown -R $USER $CONDA
# displayName: Take ownership of conda installation
# - bash: conda create --yes --quiet --name myEnvironment
# displayName: Create Anaconda environment
- script: |
python -c "import sys;print(sys.executable)"
python -c "import sys;print(sys.version_info)"
displayName: 'Print'
- script: brew install libomp
displayName: 'Install omp'
# macOS already provides this software and installing another version in parallel can cause all kinds of trouble.
# - script: brew install llvm
# displayName: 'Install llvm'
- script: |
pip install -r requirements.txt
displayName: 'Install Requirements'
- script: |
pip install -r requirements-dev.txt
displayName: 'Install Requirements dev'
- script: |
gcc --version
python -c "import sys;print('PYTHON', sys.executable)"
python -c "import sys;print('PYTHON', sys.version_info)"
python -c "import numpy;print('numpy', numpy.__version__)"
python -c "import cython;print('cython', cython.__version__)"
displayName: 'Print'
- script: |
python setup.py build_ext --inplace
displayName: 'build'
- script: |
python setup.py bdist_wheel
displayName: 'build wheel'
- script: |
source activate myEnvironment
python -m pytest _unittests --durations=10 -v
displayName: 'Runs Unit Tests'
- script: |
python -u setup.py build
displayName: 'Build Package'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel-mac-$(python.version)'
targetPath: 'dist'