forked from CATIA-Systems/FMPy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
216 lines (175 loc) · 5.42 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
variables:
- name: create_environment
value: conda create --yes --quiet --name py37 -c conda-forge python=3.7 attrs dask ipython=7 lark-parser lxml matplotlib notebook numpy plotly pyqt pyqtgraph pytest-cov requests scipy
jobs:
- job: linux
displayName: 'Ubuntu 18.04'
pool:
vmImage: 'ubuntu-18.04'
steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
- bash: $(create_environment) cmake
displayName: Create Anaconda environment
- bash: |
source activate py37
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate py37
python build_fmucontainer.py
displayName: Build FMU Container
- bash: |
source activate py37
python build_remoting.py
displayName: Build remoting binaries
- bash: |
source activate py37
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'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'linux'
- job: macosx
displayName: 'macOS 10.15'
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: $(create_environment)
displayName: Create Anaconda environment
- bash: |
source activate py37
python build_cvode.py
displayName: Build CVode binaries
- bash: |
source activate py37
python build_fmucontainer.py
displayName: Build FMU Container
- bash: |
source activate py37
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'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'macosx'
- job: windows
displayName: 'Windows 2016'
pool:
vmImage: 'vs2017-win2016'
steps:
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
- script: $(create_environment) cmake pywin32
displayName: Create Anaconda environment
- script: |
call activate py37
python build_cvode.py
displayName: Build CVode binaries
- script: |
call activate py37
python build_fmucontainer.py
displayName: Build FMU Container
- script: |
call activate py37
python build_remoting.py
displayName: Build Remoting binaries
- script: |
call activate py37
python setup.py bdist_wheel --universal
displayName: Build wheel
- task: PublishPipelineArtifact@1
inputs:
path: dist
artifact: 'windows'
- script: |
call activate py37
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'
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-18.04'
steps:
- bash: mkdir temp
displayName: Merge Python Wheels
- task: DownloadPipelineArtifact@2
inputs:
artifact: linux
downloadPath: linux
- task: DownloadPipelineArtifact@2
inputs:
artifact: macosx
downloadPath: macosx
- task: DownloadPipelineArtifact@2
inputs:
artifact: windows
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-py3-none-any.whl .
displayName: Merge Python Wheels
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: merged/FMPy-x.x.x-py3-none-any.whl
artifactName: merged