forked from dmlc/treelite
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
271 lines (269 loc) · 9.32 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
trigger:
- master
jobs:
- job: formatting_check
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
- checkout: self
submodules: recursive
- script: python -m pip install --upgrade pip cpplint pylint numpy scipy
displayName: 'Installing pylint and cpplint...'
- script: make lint
displayName: 'Running pylint and cpplint...'
- job: linux_build
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
submodules: recursive
- script: tests/ci_build/ci_build.sh cpu tests/ci_build/build_via_cmake.sh -DENABLE_PROTOBUF=ON
displayName: 'Building Treelite...'
- script: |
rm -rfv python/dist python/build
tests/ci_build/ci_build.sh cpu bash -c "cd python/ && python setup.py bdist_wheel --universal"
displayName: 'Packaging Python wheel for Treelite...'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'python_linux_whl'
targetPath: 'python/dist/'
- job: osx_build
pool:
vmImage: 'macOS-10.13'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
- checkout: self
submodules: recursive
- script: |
rm -rf build/
mkdir build
cd build
cmake .. -DENABLE_PROTOBUF=ON
make -j
displayName: 'Building Treelite...'
- script: |
rm -rfv python/dist python/build
cd python/
pip install wheel setuptools
python setup.py bdist_wheel --universal
displayName: 'Packaging Python wheel for Treelite...'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'python_osx_whl'
targetPath: 'python/dist/'
- job: win_build
pool:
vmImage: 'vs2015-win2012r2'
steps:
- checkout: self
submodules: recursive
- powershell: |
(New-Object System.Net.WebClient).DownloadFile("https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe", ".\Miniconda3.exe")
displayName: 'Downloading Miniconda...'
- script: start /wait "" Miniconda3.exe /InstallationType=JustMe /RegisterPython=0 /S /D=$(Agent.BuildDirectory)\CONDA
displayName: 'Installing Miniconda...'
- script: |
call $(Agent.BuildDirectory)\CONDA\Scripts\activate
conda install numpy scipy scikit-learn pandas
python -m pip install wheel setuptools
displayName: 'Setting up Python environment...'
- script: |
rmdir build /s /q
mkdir build
cd build
cmake .. -G"Visual Studio 14 2015 Win64" -DENABLE_PROTOBUF=ON
displayName: 'Generating Visual Studio solution...'
- task: MSBuild@1
inputs:
solution: 'build/*.sln'
msbuildArchitecture: 'x64'
msbuildArguments: '/p:Configuration=Release /m /nodeReuse:false'
displayName: 'Building Treelite...'
- script: |
call $(Agent.BuildDirectory)\CONDA\Scripts\activate
cd python
python setup.py bdist_wheel --universal
displayName: 'Packaging Python wheel for Treelite...'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'python_win_whl'
targetPath: 'python/dist/'
- job: cpp_coverage
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
- checkout: self
submodules: recursive
- script: sudo apt-get install lcov
displayName: 'Installing lcov...'
- script: |
rm -rfv build/
mkdir build/
cd build/
cmake .. -DTEST_COVERAGE=ON -DENABLE_PROTOBUF=ON -DCMAKE_BUILD_TYPE=Debug
make -j
displayName: 'Building Treelite...'
- script: python -m pip install numpy scipy pandas pytest scikit-learn xgboost lightgbm
displayName: 'Setting up Python environment...'
- script: |
PYTHONPATH=./python python -m pytest -v --fulltrace tests/python
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --remove coverage.info '*3rdparty*' --output-file coverage.info
lcov --remove coverage.info '*dmlc-core*' --output-file coverage.info
displayName: 'Running integration tests...'
- script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
displayName: 'Submitting C++ code coverage data to CodeCov...'
env:
CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255
- job: java_coverage
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
- checkout: self
submodules: recursive
- script: |
cd runtime/java/treelite4j
mvn test -DJNI.args=cpp-coverage
displayName: 'Running integration tests for Java runtime (treelite4j)...'
- script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
displayName: 'Submitting Java code (treelite4j) coverage data to CodeCov...'
env:
CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255
- job: linux_python_test
dependsOn: linux_build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
- checkout: self
submodules: recursive
- script: python -m pip install numpy scipy pandas pytest pytest-cov scikit-learn xgboost lightgbm coverage
displayName: 'Setting up Python environment...'
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'python_linux_whl'
targetPath: $(System.DefaultWorkingDirectory)
displayName: 'Downloading Treelite Python wheel for Linux...'
- script: |
mkdir -p lib/
cd lib/
unzip -j ../*.whl 'treelite-*.data/data/treelite/libtreelite.so'
cd ../runtime/native
mkdir -p lib/
cd lib/
unzip -j ../../../*.whl 'treelite-*.data/data/treelite/libtreelite_runtime.so'
mkdir -p ../build
cd ../build
cmake ..
displayName: 'Installing Treelite into Python environment...'
- script: python -m pytest -v --fulltrace tests/python --cov=./
displayName: 'Running Python tests...'
env:
PYTHONPATH: ./python
- script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
displayName: 'Submitting code coverage data to CodeCov...'
env:
CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255
- job: osx_python_test
dependsOn: osx_build
pool:
vmImage: 'macOS-10.13'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.7'
addToPath: true
- checkout: self
submodules: recursive
- script: |
python -m pip install numpy scipy pandas pytest pytest-cov scikit-learn lightgbm coverage
brew install gcc@7 libomp
displayName: 'Setting up Python environment...'
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'python_osx_whl'
targetPath: $(System.DefaultWorkingDirectory)
displayName: 'Downloading Treelite Python wheel for Mac OSX...'
- script: |
mkdir -p lib/
cd lib/
unzip -j ../*.whl 'treelite-*.data/data/treelite/libtreelite.dylib'
cd ../runtime/native
mkdir -p lib/
cd lib/
unzip -j ../../../*.whl 'treelite-*.data/data/treelite/libtreelite_runtime.dylib'
mkdir -p ../build
cd ../build
cmake ..
displayName: 'Installing Treelite into Python environment...'
- script: python -m pytest -v --fulltrace tests/python --cov=./
displayName: 'Running Python tests...'
env:
GCC_PATH: gcc-7
PYTHONPATH: ./python
- script: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
displayName: 'Submitting code coverage data to CodeCov...'
env:
CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255
- job: win_python_test
dependsOn: win_build
pool:
vmImage: 'vs2017-win2016'
steps:
- checkout: self
submodules: recursive
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: 'Add conda to PATH'
- script: |
call activate
conda install --yes --quiet numpy scipy scikit-learn pandas
displayName: 'Setting up Python environment...'
- task: DownloadPipelineArtifact@0
inputs:
artifactName: 'python_win_whl'
targetPath: $(System.DefaultWorkingDirectory)
displayName: 'Downloading Treelite Python wheel for Windows...'
- powershell: |
Dir *.whl | Rename-Item -newname { $_.name -replace ".whl", ".zip" }
Expand-Archive *.zip -DestinationPath .\whl_content
New-Item .\lib -ItemType Directory -ea 0
New-Item .\runtime\native\lib -ItemType Directory -ea 0
New-Item .\build -ItemType Directory -ea 0
Move-Item -Path .\whl_content\treelite-*.data\data\treelite\treelite.dll -Destination .\lib
Move-Item -Path .\whl_content\treelite-*.data\data\treelite\treelite_runtime.dll -Destination .\runtime\native\lib
Remove-Item .\whl_content -Force -Recurse
Set-Location -Path .\build
cmake .. -G"Visual Studio 15 2017 Win64"
displayName: 'Installing Treelite into Python environment...'
- script: |
call activate
python -m pip install wheel setuptools xgboost lightgbm pytest pytest-cov
python -m pytest -v --fulltrace tests\python --cov=./
displayName: 'Running Python tests...'
env:
PYTHONPATH: .\python
- script: |
choco install codecov
codecov
displayName: 'Submitting code coverage data to CodeCov...'
env:
CODECOV_TOKEN: afe9868c-2c27-4853-89fa-4bc5d3d2b255