forked from microsoft/snmalloc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
267 lines (214 loc) · 7.24 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
resources:
- repo: self
phases:
- phase: LinuxSelfHost
queue:
name: 'Hosted Ubuntu 1604'
steps:
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y ninja-build libc++-dev libc++abi-dev libc++abi1 libstdc++-7-dev
# sudo apt-get install clang-6.0 clang++-6.0
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
sudo update-alternatives --set cc /usr/bin/clang
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
sudo update-alternatives --set c++ /usr/bin/clang++
displayName: 'Install Build Dependencies'
- task: CMake@1
displayName: 'CMake .. -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-stdlib=libstdc++ -std=c++17"'
inputs:
cmakeArgs: '.. -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-stdlib=libstdc++ -std=c++17"'
- script: |
ninja
workingDirectory: build
failOnStderr: true
displayName: 'Compile'
- script: |
sudo cp libsnmallocshim.so /usr/local/lib/
sudo cp libsnmallocshim-1mib.so /usr/local/lib/
ninja clean
LD_PRELOAD=/usr/local/lib/libsnmallocshim.so ninja
ninja clean
LD_PRELOAD=/usr/local/lib/libsnmallocshim-1mib.so ninja
workingDirectory: build
failOnStderr: true
displayName: 'LD_PRELOAD Compile'
- phase: Linux
queue:
name: 'Hosted Ubuntu 1604'
parallel: 2
matrix:
Debug:
BuildType: Debug
Release:
BuildType: Release
steps:
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y ninja-build libc++-dev libc++abi-dev libc++abi1 libstdc++-7-dev
# sudo apt-get install clang-6.0 clang++-6.0
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
sudo update-alternatives --set cc /usr/bin/clang
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
sudo update-alternatives --set c++ /usr/bin/clang++
displayName: 'Install Build Dependencies'
- task: CMake@1
displayName: 'CMake .. -GNinja -DCMAKE_BUILD_TYPE=$(BuildType) -DCMAKE_CXX_FLAGS="-stdlib=libstdc++ -std=c++17"'
inputs:
cmakeArgs: '.. -GNinja -DCMAKE_BUILD_TYPE=$(BuildType) -DCMAKE_CXX_FLAGS="-stdlib=libstdc++ -std=c++17"'
- script: |
ninja
workingDirectory: build
failOnStderr: true
displayName: 'Compile'
- script: |
ctest -j 4 --output-on-failure -C $(BuildType)
workingDirectory: build
failOnStderr: true
displayName: 'Test'
- phase: LinuxGCC
queue:
name: 'Hosted Ubuntu 1604'
parallel: 2
matrix:
Debug:
BuildType: Debug
Release:
BuildType: Release
steps:
- script: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y ninja-build libc++-dev libc++abi-dev libc++abi1 libstdc++-7-dev gcc-7
# sudo apt-get install clang-6.0 clang++-6.0
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-7 100
sudo update-alternatives --set cc /usr/bin/gcc-7
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-7 100
sudo update-alternatives --set c++ /usr/bin/g++-7
displayName: 'Install Build Dependencies'
- task: CMake@1
displayName: 'CMake .. -GNinja -DCMAKE_BUILD_TYPE=$(BuildType) -DCMAKE_CXX_FLAGS="-std=c++17"'
inputs:
cmakeArgs: '.. -GNinja -DCMAKE_BUILD_TYPE=$(BuildType) -DCMAKE_CXX_FLAGS="-std=c++17"'
- script: |
ninja
workingDirectory: build
failOnStderr: true
displayName: 'Compile'
- script: |
ctest -j 4 --output-on-failure -C $(BuildType)
workingDirectory: build
failOnStderr: true
displayName: 'Test'
- phase: Windows64bit
queue:
name: 'Hosted VS2017'
parallel: 2
matrix:
Debug:
BuildType: Debug
Release:
BuildType: Release
steps:
- task: CMake@1
displayName: 'CMake .. -G"Visual Studio 15 2017 Win64"'
inputs:
cmakeArgs: '.. -G"Visual Studio 15 2017 Win64"'
- task: MSBuild@1
displayName: 'Build solution build/snmalloc.sln'
inputs:
solution: build/snmalloc.sln
msbuildArguments: '/m /p:Configuration=$(BuildType)'
- script: 'ctest -j 4 --interactive-debug-mode 0 --output-on-failure -C $(BuildType)'
workingDirectory: build
displayName: 'Run Ctest'
- phase: Windows8Compat
queue:
name: 'Hosted VS2017'
parallel: 2
matrix:
Release:
BuildType: Release
steps:
- task: CMake@1
displayName: 'CMake .. -G"Visual Studio 15 2017 Win64"'
inputs:
cmakeArgs: '.. -G"Visual Studio 15 2017 Win64" -DWIN8COMPAT=TRUE'
- task: MSBuild@1
displayName: 'Build solution build/snmalloc.sln'
inputs:
solution: build/snmalloc.sln
msbuildArguments: '/m /p:Configuration=$(BuildType)'
- script: 'ctest -j 4 --interactive-debug-mode 0 --output-on-failure -C $(BuildType)'
workingDirectory: build
displayName: 'Run Ctest'
- phase: Windows32bit
queue:
name: 'Hosted VS2017'
parallel: 2
matrix:
Debug:
BuildType: Debug
Release:
BuildType: Release
steps:
- task: CMake@1
displayName: 'CMake .. -G"Visual Studio 15 2017"'
inputs:
cmakeArgs: '.. -G"Visual Studio 15 2017"'
- task: MSBuild@1
displayName: 'Build solution build/snmalloc.sln'
inputs:
solution: build/snmalloc.sln
msbuildArguments: '/m /p:Configuration=$(BuildType)'
- script: 'ctest -j 4 --interactive-debug-mode 0 --output-on-failure -C $(BuildType)'
workingDirectory: build
displayName: 'Run Ctest'
- phase: macOS
queue:
name: 'Hosted macOS'
parallel: 2
matrix:
Debug:
BuildType: Debug
Release:
BuildType: Release
steps:
- task: CMake@1
displayName: 'CMake .. -DCMAKE_BUILD_TYPE=$(BuildType)'
inputs:
cmakeArgs: '.. -DCMAKE_BUILD_TYPE=$(BuildType)'
- script: |
make -j 4
workingDirectory: build
failOnStderr: true
displayName: 'Compile'
- script: |
ctest -j 4 --output-on-failure -C $(BuildType)
workingDirectory: build
failOnStderr: true
displayName: 'Test'
- phase: Format
queue:
name: 'Hosted Ubuntu 1604'
steps:
- script: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main"
sudo apt-get update
sudo apt-get install -y clang-format-8 clang-tidy-8
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-8 100
displayName: 'Install clang'
- script: |
bash check-format.sh
displayName: 'Clang-Format'
- script: |
clang-tidy-8 src/override/malloc.cc -header-filter="`pwd`/*" -export-fixes=tidy.fail -- -std=c++17 -mcx16
if [ -f tidy.fail ] ; then exit 1 ; fi
displayName: 'Clang-Tidy'