forked from vadimcn/codelldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
320 lines (273 loc) · 9.36 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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
variables:
lldbBuildId: 1211
lldbBuildProject: 'llvm'
lldbBuildPipeline: 'llvm-project'
rustcVersion: 'nightly-2020-01-15'
cacheDiscr: F
AZP_CACHING_CONTENT_FORMAT: SingleTar
AZP_CACHING_TAR: true
setenvLinux: |
export PATH=$HOME/.cargo/bin:$PATH
setenvOSX: |
export PATH=$HOME/.cargo/bin:$PATH
setenvWindows: |
set PATH=%USERPROFILE%\.cargo\bin;%PATH%
set PYTHONHOME=%USEPYTHONVERSION_PYTHONLOCATION%
set PYTHONPATH=%PYTHONHOME%\Lib;%PYTHONHOME%\DLLs
########################################################################################################################
jobs:
- job: Linux
pool:
vmImage: 'Ubuntu 16.04'
strategy:
matrix:
x86_64:
PlatformId: 'x86_64-linux'
Triple: 'x86_64-linux-gnu'
RustTarget: 'x86_64-unknown-linux-gnu'
CrossBuilding: false
arm:
PlatformId: 'arm-linux'
Triple: 'arm-linux-gnueabihf'
RustTarget: 'armv7-unknown-linux-gnueabihf'
CrossBuilding: true
aarch64:
PlatformId: 'aarch64-linux'
Triple: 'aarch64-linux-gnu'
RustTarget: 'aarch64-unknown-linux-gnu'
CrossBuilding: true
variables:
cachePrefix: $(cacheDiscr) | $(Triple)
container:
image: 'vadimcn/linux-builder:latest'
options: --privileged
steps:
- script: |
rustup self update
rustup toolchain install $(rustcVersion)
rustup default $(rustcVersion)
rustup target add $(RustTarget)
rustup show
displayName: 'Install Rust'
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
project: $(lldbBuildProject)
pipeline: $(lldbBuildPipeline)
buildId: $(lldbBuildId)
buildVersionToDownload: specific
downloadType: single
artifactName: 'lldb--$(Triple)'
itemPattern: 'lldb--$(Triple)/lldb--$(Triple).zip'
downloadPath: '$(Agent.BuildDirectory)/D'
displayName: 'Download LLDB'
- task: CacheBeta@0
inputs:
key: $(cachePrefix) | node_modules | $(Build.BuildId)
restoreKeys: |
$(cachePrefix) | node_modules | $(Build.BuildId)
$(cachePrefix) | node_modules
path: $(Build.SourcesDirectory)/build/node_modules
continueOnError: true
displayName: Cache node_modules
condition: always()
- script: |
$(setenvLinux)
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
unzip $(Agent.BuildDirectory)/D/lldb--$(Triple)/lldb--$(Triple).zip -d $(Agent.BuildDirectory)/D/lldb
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo\
-DLLDB_ROOT=$(Agent.BuildDirectory)/D/lldb\
-DCMAKE_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/cmake/toolchain-$(Triple).cmake\
..
cat CMakeCache.txt
displayName: 'Configure'
- script: |
$(setenvLinux)
cmake --build build --target vsix_portable
cmake -E copy build/codelldb-portable.vsix $(Build.ArtifactStagingDirectory)/codelldb-portable.vsix
cmake -E copy build/package.json $(Build.ArtifactStagingDirectory)/package.json
displayName: 'Build portable package'
condition: not(eq(variables.CrossBuilding, 'true'))
- script: |
$(setenvLinux)
cmake --build build --target vsix_full
cmake -E copy build/codelldb-full.vsix $(Build.ArtifactStagingDirectory)/codelldb-$(PlatformId).vsix
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'codelldb-$(PlatformId)'
- script: |
$(setenvLinux)
cmake --build build --target check
displayName: 'Test'
condition: not(eq(variables.CrossBuilding, 'true'))
- script: |
echo - env ------------------
env
echo - dir -----------------------
ls -R $(Agent.BuildDirectory)
displayName: 'On Failure'
condition: failed()
########################################################################################################################
- job: OSX
pool:
vmImage: 'macOS 10.13'
variables:
cachePrefix: $(cacheDiscr) | x86_64-apple-darwin
PlatformId: 'x86_64-darwin'
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
project: $(lldbBuildProject)
pipeline: $(lldbBuildPipeline)
buildId: $(lldbBuildId)
buildVersionToDownload: specific
downloadType: single
artifactName: 'lldb--x86_64-apple-darwin'
itemPattern: 'lldb--x86_64-apple-darwin/lldb--x86_64-apple-darwin.zip'
downloadPath: '$(Agent.BuildDirectory)/D'
displayName: 'Download LLDB'
- task: CacheBeta@0
inputs:
key: $(cachePrefix) | node_modules | $(Build.BuildId)
restoreKeys: |
$(cachePrefix) | node_modules | $(Build.BuildId)
$(cachePrefix) | node_modules
path: $(Build.SourcesDirectory)/build/node_modules
continueOnError: true
displayName: Cache node_modules
condition: always()
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -v -y --profile minimal --default-toolchain none
source $HOME/.cargo/env
rustup toolchain install $(rustcVersion)
rustup default $(rustcVersion)
rustup show
displayName: 'Install Rust'
- script: |
$(setenvOSX)
unzip $(Agent.BuildDirectory)/D/lldb--x86_64-apple-darwin/lldb--x86_64-apple-darwin.zip -d $(Agent.BuildDirectory)/D/lldb
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo\
-DLLDB_ROOT=$(Agent.BuildDirectory)/D/lldb\
..
cat CMakeCache.txt
displayName: 'Configure'
- script: |
$(setenvOSX)
cmake --build build --target vsix_full
cmake -E copy build/codelldb-full.vsix $(Build.ArtifactStagingDirectory)/codelldb-$(PlatformId).vsix
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'codelldb-$(PlatformId)'
- script: |
$(setenvOSX)
cmake --build build --target check
displayName: 'Test'
- script: |
echo - env ------------------
env
echo - dir -----------------------
ls -R $(Agent.BuildDirectory)
displayName: 'On Failure'
condition: failed()
########################################################################################################################
- job: Windows
pool:
vmImage: 'VS2017-Win2016'
variables:
cachePrefix: $(cacheDiscr) | x86_64-windows
PlatformId: 'x86_64-windows'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.6'
addToPath: true
architecture: 'x64'
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
project: $(lldbBuildProject)
pipeline: $(lldbBuildPipeline)
buildId: $(lldbBuildId)
buildVersionToDownload: specific
downloadType: single
artifactName: 'lldb--x86_64-windows-msvc'
itemPattern: 'lldb--x86_64-windows-msvc/lldb--x86_64-windows-msvc.zip'
downloadPath: '$(Agent.BuildDirectory)/D'
displayName: 'Download LLDB'
- task: CacheBeta@0
inputs:
key: $(cachePrefix) | node_modules | $(Build.BuildId)
restoreKeys: |
$(cachePrefix) | node_modules | $(Build.BuildId)
$(cachePrefix) | node_modules
path: $(Build.SourcesDirectory)/build/node_modules
continueOnError: true
displayName: Cache node_modules
condition: always()
- task: BatchScript@1
inputs:
filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
arguments: -arch=amd64 -host_arch=amd64
modifyEnvironment: true
displayName: VsDevCmd
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -v -y --profile minimal --default-toolchain none
set PATH=%USERPROFILE%\.cargo\bin;%PATH%
rustup toolchain install $(rustcVersion)-x86_64-pc-windows-gnu
rustup default $(rustcVersion)-x86_64-pc-windows-gnu
rustup target add x86_64-pc-windows-msvc
rustup show
displayName: 'Install Rust'
- script: |
choco install ninja
choco install zip
unzip $(Agent.BuildDirectory)/D/lldb--x86_64-windows-msvc/lldb--x86_64-windows-msvc.zip -d $(Agent.BuildDirectory)/D/lldb
displayName: 'Install other'
- script: |
$(setenvWindows)
mkdir build
cd build
cmake -GNinja^
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
-DLLDB_ROOT=$(Agent.BuildDirectory)\D\lldb^
-DCMAKE_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/cmake/toolchain-x86_64-windows-msvc.cmake^
..
type CMakeCache.txt
displayName: 'Configure'
- script: |
$(setenvWindows)
cmake --build build --target vsix_full
cmake -E copy build/codelldb-full.vsix $(Build.ArtifactStagingDirectory)/codelldb-$(PlatformId).vsix
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'codelldb-$(PlatformId)'
- script: |
$(setenvWindows)
cmake --build build --target check
displayName: 'Test'
- script: |
echo - env ------------------
env
echo - dir -----------------------
ls -R $(Agent.BuildDirectory)
displayName: 'On Failure'
condition: failed()