forked from CATIA-Systems/FMPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
245 lines (203 loc) · 6.84 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
jobs:
- job: linux
displayName: 'Ubuntu 16.04'
strategy:
matrix:
python27:
python.version: '2.7'
python.libraries: 'pathlib'
python37:
python.version: '3.7'
python.libraries: 'ipython=7 notebook'
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: conda create --yes --quiet --name myEnvironment
displayName: Create Anaconda environment
- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION cmake dask lark-parser lxml matplotlib numpy plotly pyqt pyqtgraph pytest-cov requests scipy $PYTHON_LIBRARIES
displayName: Install Anaconda packages
- bash: |
source activate myEnvironment
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate myEnvironment
python build_fmucontainer.py
displayName: Build FMU Container
- bash: |
source activate myEnvironment
python setup.py bdist_wheel --universal
for f in dist/FMPy-*.whl; do
pip install $f --no-deps -vv
done
cd tests
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml
cd ..
displayName: Build, install and run tests
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'linux-python-$(python.version)'
- job: macosx
displayName: 'macOS 10.15'
strategy:
matrix:
python27:
python.version: '2.7'
python.libraries: 'pathlib'
python38:
python.version: '3.7'
python.libraries: 'ipython=7 notebook'
pool:
vmImage: 'macos-10.15'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
# On Hosted macOS, the agent user doesn't have ownership of Miniconda's installation directory/
# We need to take ownership if we want to update conda or install packages globally
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
- bash: conda create --yes --quiet --name myEnvironment
displayName: Create Anaconda environment
- bash: |
source activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=$PYTHON_VERSION dask lark-parser lxml matplotlib numpy plotly pyqt pyqtgraph pytest-cov requests scipy $PYTHON_LIBRARIES
displayName: Install Anaconda packages
- bash: |
source activate myEnvironment
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate myEnvironment
python build_fmucontainer.py
displayName: Build FMU Container
- bash: |
source activate myEnvironment
python setup.py bdist_wheel --universal
for f in dist/FMPy-*.whl; do
pip install $f --no-deps -vv
done
cd tests
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml
cd ..
displayName: Build, install and run tests
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'macosx-python-$(python.version)'
- job: windows
displayName: 'Windows 2016'
strategy:
matrix:
# lxml broken for Python 2.7
# python27:
# python.version: '2.7'
python37:
python.version: '3.7'
pool:
vmImage: 'vs2017-win2016'
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: conda create --yes --quiet --name myEnvironment
displayName: Create Anaconda environment
- script: |
call activate myEnvironment
conda install --yes --quiet --name myEnvironment -c conda-forge python=%PYTHON_VERSION% cmake dask ipython=7 lark-parser lxml matplotlib notebook numpy plotly pyqt pyqtgraph pytest-cov pywin32 requests scipy
displayName: Install Anaconda packages
- script: |
call activate myEnvironment
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate myEnvironment
python build_fmucontainer.py
displayName: Build FMU Container
- script: |
call activate myEnvironment
python build_remoting.py
displayName: Build Remoting binaries
- script: |
call activate myEnvironment
python setup.py bdist_wheel --universal
displayName: Build wheel
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'windows-python-$(python.version)'
- script: |
call activate myEnvironment
for %%f in (dist\FMPy-*.whl) do pip install %%f --no-deps
cd tests
pytest --junitxml=junit/test-results.xml --cov=fmpy --cov-report=xml
cd ..
displayName: Install wheel and run tests
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
failTaskOnFailedTests: true
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- job: merge
dependsOn:
- linux
- macosx
- windows
displayName: 'Merge Python Wheels'
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: mkdir temp
displayName: Merge Python Wheels
- task: DownloadPipelineArtifact@2
inputs:
artifact: linux-python-3.7
downloadPath: linux
- task: DownloadPipelineArtifact@2
inputs:
artifact: macosx-python-3.7
downloadPath: macosx
- task: DownloadPipelineArtifact@2
inputs:
artifact: windows-python-3.7
downloadPath: windows
- bash: |
unzip -o linux/*.whl -d merged
unzip -o macosx/*.whl -d merged
unzip -o windows/*.whl -d merged
cd merged
zip -r FMPy-x.x.x-py2.py3-none-any.whl .
displayName: Merge FMUs
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: merged/FMPy-x.x.x-py2.py3-none-any.whl
artifactName: merged