forked from eclipse-openj9/openj9-omr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
295 lines (259 loc) · 8.73 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
trigger:
- master
pr:
- master
jobs:
- job:
displayName: 'Check line endings'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
allFiles=`git diff -C --diff-filter=ACM --name-only origin/master HEAD --`
if [ x"$allFiles" = x ] ; then
echo "There are no files to check for line endings."
else
badFiles=
for file in $allFiles ; do
type=`file -b $file`
case "$type" in
*empty*)
echo "Empty file: '$file'"
;;
*text*)
lcFile=`echo $file | tr '[:upper:]' '[:lower:]'`
case "$lcFile" in
*.bat | *.cmd)
case "$type" in
*CRLF*)
echo "Good windows script: '$file' type: '$type'"
;;
*)
echo "ERROR - should have CRLF line terminators: '$file' type: '$type'"
badFiles="$badFiles $file"
;;
esac
;;
*)
case "$type" in
*CR*)
echo "ERROR - should have LF line terminators: '$file' type: '$type'"
badFiles="$badFiles $file"
;;
*)
echo "Good text file: '$file' type: '$type'"
;;
esac
;;
esac
;;
*)
echo "Non-text file: '$file' type: '$type'"
;;
esac
done
hashes='###################################'
if [ x"$badFiles" != x ] ; then
echo "$hashes"
echo "The following files were modified and have incorrect line endings:"
for file in $badFiles ; do
echo "$file"
done
echo "$hashes"
exit 1
else
git config core.whitespace blank-at-eof,blank-at-eol,cr-at-eol,space-before-tab
checkErrors=`git diff --check origin/master HEAD --`
if [ x"$checkErrors" = x ] ; then
echo "All modified files appear to have correct line endings."
else
echo "Found the following whitespace problems:"
echo "$hashes"
git diff --check origin/master HEAD --
echo "$hashes"
exit 1
fi
fi
fi
displayName: 'Check modified files'
- job:
displayName: 'x86-64 Windows'
pool:
vmImage: vs2017-win2016
steps:
- script: |
mkdir build
displayName: 'Create build directory'
- script: |
set PATH=C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64;%PATH%
cmake .. -G "Visual Studio 15 2017 Win64" -C../cmake/caches/Windows.cmake .. -DOMR_DDR=0 -DOMR_TEST_COMPILER=ON -DOMR_JITBUILDER_TEST=ON
displayName: 'Configure'
workingDirectory: 'build'
- script: |
cmake --build . -- -maxCpuCount
displayName: 'Build'
workingDirectory: 'build'
- script: |
ctest -V -C Debug
displayName: "Test"
workingDirectory: 'build'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/*results.xml'
displayName: 'Publish results'
- job:
displayName: 'x86-64 Linux'
pool:
vmImage: 'ubuntu-18.04'
variables:
CCACHE_DIR: $(Pipeline.Workspace)/ccache
steps:
- script: |
sudo apt-get install -y ccache libelf-dev libdwarf-dev
displayName: 'Install prerequisites'
- script: |
PARALLELISM=$(grep -c '^processor' /proc/cpuinfo)
echo "Number of parallel jobs: $PARALLELISM"
echo "##vso[task.setvariable variable=NUMBER_OF_PROCESSORS]$PARALLELISM"
echo "##vso[task.prependpath]/usr/lib/ccache"
displayName: 'Initialize environment'
- script: |
mkdir build
displayName: 'Create build directory'
- task: Cache@2
inputs:
key: 'ccache | "$(Agent.OS)" | azure-pipelines.cache'
path: $(CCACHE_DIR)
displayName: 'Save/Restore ccache'
- script: |
ccache -s -z
displayName: 'Print cache stats'
- script: |
cmake -C ../cmake/caches/Travis.cmake ..
displayName: 'Configure'
workingDirectory: 'build'
- script: |
make -j$NUMBER_OF_PROCESSORS
displayName: 'Build'
workingDirectory: 'build'
- script: |
ccache -s -z
displayName: 'Print cache stats'
- script: |
ctest -V -j$NUMBER_OF_PROCESSORS
displayName: "Test"
workingDirectory: 'build'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/*results.xml'
displayName: 'Publish results'
- job:
displayName: 'x86-64 macOS'
pool:
vmImage: 'macOS-10.14'
variables:
CCACHE_DIR: $(Pipeline.Workspace)/ccache
steps:
- script: |
brew install ccache
displayName: 'Install prerequisites'
- script: |
sudo sysctl -w kern.maxproc=25000
sudo sysctl -w kern.maxprocperuid=25000
PARALLELISM=$(sysctl -a | grep machdep.cpu.core_count | cut -d ' ' -f 2)
echo "Number of parallel jobs: $PARALLELISM"
echo "##vso[task.setvariable variable=NUMBER_OF_PROCESSORS]$PARALLELISM"
echo "##vso[task.prependpath]/usr/local/opt/ccache/libexec"
displayName: 'Initialize environment'
- script: |
mkdir build
displayName: 'Create build directory'
- task: Cache@2
inputs:
key: 'ccache | "$(Agent.OS)" | azure-pipelines.cache'
path: $(CCACHE_DIR)
displayName: 'Save/Restore ccache'
- script: |
ccache -s -z
displayName: 'Print cache stats'
- script: |
cmake -C ../cmake/caches/Travis.cmake ..
displayName: 'Configure'
workingDirectory: 'build'
- script: |
make -j$NUMBER_OF_PROCESSORS
displayName: 'Build'
workingDirectory: 'build'
- script: |
ccache -s -z
displayName: 'Print cache stats'
- script: |
ctest -V -j$NUMBER_OF_PROCESSORS
displayName: "Test"
workingDirectory: 'build'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/*results.xml'
displayName: 'Publish results'
- job:
condition: False
displayName: 'Linter'
pool:
vmImage: 'ubuntu-16.04'
variables:
CCACHE_DIR: $(Pipeline.Workspace)/ccache
CLANG: clang++-3.8
CXX: clang++-3.8
CXX_PATH: clang++-3.8
LLVM_CONFIG: llvm-config-3.8
SPEC: linux_x86-64
PLATFORM: amd64-linux64-gcc
steps:
- script: |
sudo apt-get install -y ccache clang-3.8 libclang-3.8-dev llvm-3.8 llvm-3.8-dev
displayName: 'Install prerequisites'
- script: |
PARALLELISM=$(grep -c '^processor' /proc/cpuinfo)
echo "Number of parallel jobs: $PARALLELISM"
echo "##vso[task.setvariable variable=NUMBER_OF_PROCESSORS]$PARALLELISM"
echo "##vso[task.prependpath]/usr/lib/ccache"
displayName: 'Initialize environment'
- task: Cache@2
inputs:
key: 'ccache | "$(Agent.OS)" | azure-pipelines.cache'
path: $(CCACHE_DIR)
displayName: 'Save/Restore ccache'
- script: |
ccache -s -z
displayName: 'Print cache stats'
- script: |
make -f run_configure.mk OMRGLUE=./example/glue RUN_LINT=yes RUN_BUILD=no HAS_AUTOCONF=1 all
displayName: 'Configure'
- script: |
make -j$NUMBER_OF_PROCESSORS lint
displayName: 'Run linter for x86'
env:
TARGET_ARCH: x
TARGET_SUBARCH: amd64
TARGET_BITS: 64
- script: |
make -j$NUMBER_OF_PROCESSORS lint
displayName: 'Run linter for Power'
env:
TARGET_ARCH: p
TARGET_BITS: 64
- script: |
make -j$NUMBER_OF_PROCESSORS lint
displayName: 'Run linter for z/Architecture'
env:
TARGET_ARCH: z
TARGET_BITS: 64
- script: |
ccache -s -z
displayName: 'Print cache stats'