forked from microsoft/snmalloc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
215 lines (175 loc) · 5.37 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
trigger:
- master
pr:
- master
jobs:
- job:
displayName: Linux
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Clang-6 Debug:
CC: clang-6.0
CXX: clang++-6.0
BuildType: Debug
SelfHost: false
CMakeArgs: ''
Clang-6 Release:
CC: clang-6.0
CXX: clang++-6.0
BuildType: Release
SelfHost: false
CMakeArgs: ''
GCC-7 Debug:
CC: gcc-7
CXX: g++-7
BuildType: Debug
SelfHost: false
CMakeArgs: ''
GCC-7 Release:
CC: gcc-7
CXX: g++-7
BuildType: Release
SelfHost: false
CMakeArgs: ''
Self Host:
CC: clang-6.0
CXX: clang++-6.0
BuildType: Debug
SelfHost: true
CMakeArgs: ''
Cache Friendly:
CC: clang-6.0
CXX: clang++-6.0
BuildType: Debug
SelfHost: false
CMakeArgs: '-DCACHE_FRIENDLY_OFFSET=64'
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 g++-7
# sudo apt-get install clang-6.0 clang++-6.0
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/$(CC) 100
sudo update-alternatives --set cc /usr/bin/$(CC)
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/$(CXX) 100
sudo update-alternatives --set c++ /usr/bin/$(CXX)
CMAKE_CXX_FLAGS="-std=c++17"
if [[ "$CXX" == clang++* ]]; then CMAKE_CXX_FLAGS+=" -stdlib=libstdc++"; fi
displayName: 'Install Build Dependencies'
- task: CMake@1
displayName: 'CMake .. $(CMakeArgs) -GNinja -DCMAKE_BUILD_TYPE=$(BuildType) -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" -DSNMALLOC_CI_BUILD=On'
inputs:
cmakeArgs: '.. $(CMakeArgs) -GNinja -DCMAKE_BUILD_TYPE=$(BuildType) -DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" -DSNMALLOC_CI_BUILD=On'
- script: |
ninja
workingDirectory: build
failOnStderr: true
displayName: 'Compile'
- script: |
if [ $(SelfHost) = false ]; then
ctest -j 4 --output-on-failure -C $(BuildType)
else
sudo cp libsnmallocshim.so 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
fi
workingDirectory: build
failOnStderr: true
displayName: 'Test'
- job:
displayName: Windows
pool:
vmImage: 'vs2017-win2016'
strategy:
matrix:
64-bit Debug:
BuildType: Debug
CMakeArgs: '-G"Visual Studio 15 2017 Win64"'
JFlag: -j 4
64-bit Release:
BuildType: Release
CMakeArgs: '-G"Visual Studio 15 2017 Win64"'
JFlag: '-j 2'
64-bit Release Windows8Compat:
BuildType: Release
CMakeArgs: '-G"Visual Studio 15 2017 Win64" -DWIN8COMPAT=TRUE'
JFlag: '-j 2'
32-bit Debug:
BuildType: Debug
CMakeArgs: '-G"Visual Studio 15 2017"'
JFlag: '-j 4'
32-bit Release:
BuildType: Release
CMakeArgs: '-G"Visual Studio 15 2017"'
JFlag: '-j 2'
steps:
- script: |
bash -c "cat /proc/cpuinfo"
bash -c "cat /proc/meminfo"
displayName: 'Machine stats'
- task: CMake@1
displayName: 'CMake .. $(CMakeArgs) -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On'
inputs:
cmakeArgs: '.. $(CMakeArgs) -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On'
- task: MSBuild@1
displayName: 'Build solution build/snmalloc.sln'
inputs:
solution: build/snmalloc.sln
msbuildArguments: '/m /p:Configuration=$(BuildType)'
- script: 'ctest $(JFlag) --interactive-debug-mode 0 --output-on-failure -C $(BuildType)'
workingDirectory: build
displayName: 'Run Ctest'
- job:
displayName: macOS
pool:
vmImage: 'macOS-10.13'
strategy:
matrix:
Debug:
BuildType: Debug
Release:
BuildType: Release
steps:
- task: CMake@1
displayName: 'CMake .. -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On'
inputs:
cmakeArgs: '.. -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On'
- 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'
- job:
displayName: Format
pool:
vmImage: 'ubuntu-16.04'
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'
- task: CMake@1
displayName: 'CMake ..'
inputs:
cmakeArgs: '..'
- script: |
make clangformat
if [ "$(git diff $(Build.SourceVersion))" != "" ]; then exit 1; fi
workingDirectory: build
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'