-
Notifications
You must be signed in to change notification settings - Fork 137
/
azure-pipelines.yml
318 lines (281 loc) · 10 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
###############################################################################
# Copyright IBM Corp. and others 2020
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
# distribution and is available at https://www.eclipse.org/legal/epl-2.0/
# or the Apache License, Version 2.0 which accompanies this distribution
# and is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception [1] and GNU General Public
# License, version 2 with the OpenJDK Assembly Exception [2].
#
# [1] https://www.gnu.org/software/classpath/license.html
# [2] https://openjdk.org/legal/assembly-exception.html
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
###############################################################################
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: windows-2019
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 16 2019" -A x64 -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-latest'
variables:
CCACHE_DIR: $(Pipeline.Workspace)/ccache
GTEST_FILTER: -*dump_test_create_dump_*
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-latest'
variables:
CCACHE_DIR: $(Pipeline.Workspace)/ccache
GTEST_FILTER: -*.poll_functionality_basic:*poll_functionality_many_sockets
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'