forked from interpretml/interpret
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
185 lines (178 loc) · 5.5 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
jobs:
- job: 'Build_Native'
strategy:
matrix:
Linux:
python.version: '3.6'
image.name: 'ubuntu-16.04'
Windows:
python.version: '3.6'
image.name: 'windows-2019'
Mac:
python.version: '3.6'
image.name: 'macOS-10.13'
maxParallel: 3
pool:
vmImage: '$(image.name)'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: |
chmod +x build.sh
./build.sh
condition: in(variables['image.name'], 'ubuntu-16.04', 'macOS-10.13')
displayName: 'Building/moving native code (linux/mac).'
- script: |
set PATH=C:\Windows\system32\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
build.bat
condition: in(variables['image.name'], 'windows-2019')
displayName: 'Building/moving native code. (win)'
- task: CopyFiles@2
condition: succeeded()
inputs:
sourceFolder: staging
contents: 'ebmcore_*'
targetFolder: '$(Build.ArtifactStagingDirectory)'
displayName: 'Move binary to staging'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: native-$(image.name)
displayName: 'Publish native library'
- job: 'Build_Package'
dependsOn: 'Build_Native'
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'specific'
displayName: 'Download build artifacts'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
architecture: 'x64'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- task: CopyFiles@2
inputs:
sourceFolder: '$(System.ArtifactsDirectory)'
contents: '**/ebmcore_*'
targetFolder: 'src/python/interpret/lib'
flattenFolders: true
displayName: 'Move binary to Python layer'
- script: python setup.py bdist_wheel -d ../../staging
condition: succeeded()
workingDirectory: src/python
displayName: 'Build wheel'
- task: CopyFiles@2
condition: succeeded()
inputs:
sourceFolder: staging
contents: '*.whl'
targetFolder: '$(Build.ArtifactStagingDirectory)'
displayName: 'Move wheel for Build Artifact'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'wheel'
displayName: 'Publish wheel as Build Artifact'
- job: 'Test'
dependsOn: 'Build_Package'
strategy:
matrix:
LinuxPython35:
python.version: '3.5'
image.name: 'ubuntu-16.04'
LinuxPython36:
python.version: '3.6'
image.name: 'ubuntu-16.04'
LinuxPython37:
python.version: '3.7'
image.name: 'ubuntu-16.04'
WindowsPython35:
python.version: '3.5'
image.name: 'vs2017-win2016'
WindowsPython36:
python.version: '3.6'
image.name: 'vs2017-win2016'
WindowsPython37:
python.version: '3.7'
image.name: 'vs2017-win2016'
MacPython35:
python.version: '3.5'
image.name: 'macOS-10.13'
MacPython36:
python.version: '3.6'
image.name: 'macOS-10.13'
MacPython37:
python.version: '3.7'
image.name: 'macOS-10.13'
maxParallel: 9
pool:
vmImage: '$(image.name)'
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'specific'
displayName: 'Download build artifacts'
- task: CopyFiles@2
inputs:
sourceFolder: '$(System.ArtifactsDirectory)'
contents: '**/ebmcore_*.*'
targetFolder: 'src/python/interpret/lib'
flattenFolders: true
displayName: 'Move binary to Python layer'
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: |
python -m pip install numpy scipy pyscaffold
workingDirectory: src/python
displayName: 'Install numpy/scipy/pyscaffold first for mis-specified pip packages.'
- script: |
mkdir -p ~/.matplotlib
echo "backend: TkAgg" >> ~/.matplotlib/matplotlibrc
condition: in(variables['image.name'], 'macOS-10.13')
displayName: 'Matplotlib patch for mac.'
- script: |
python -m pip install -r requirements.txt
workingDirectory: src/python
displayName: 'Install requirements'
- script: |
python -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
workingDirectory: src/python
displayName: 'Run pytest'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version) at $(image.name)'
displayName: 'Publish test results'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
displayName: 'Publish test coverage results'
- job: 'Publish_Package'
dependsOn: 'Test'
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'wheel'
- task: PublishPipelineArtifact@0
inputs:
sourceFolder: '$(System.ArtifactsDirectory)'
artifactName: 'drop'