blob: 862cced1cc56fdad291041e714d687861a00689b [file] [log] [blame]
Bin Mengc7072d12019-10-27 05:19:48 -07001variables:
2 windows_vm: vs2015-win2012r2
Bin Mengddaa6b12019-10-28 07:25:03 -07003 ubuntu_vm: ubuntu-18.04
Tom Rini17e41f22019-10-31 10:45:03 -04004 ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20191010-20Oct2019
Bin Mengddaa6b12019-10-28 07:25:03 -07005 # Add '-u 0' options for Azure pipelines, otherwise we get "permission
6 # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer",
7 # since our $(ci_runner_image) user is not root.
8 container_option: -u 0
9 work_dir: /u
Bin Mengc7072d12019-10-27 05:19:48 -070010
11jobs:
12 - job: tools_only_windows
13 displayName: 'Ensure host tools build for Windows'
14 pool:
15 vmImage: $(windows_vm)
16 strategy:
17 matrix:
18 i686:
19 MSYS_DIR: msys32
20 BASE_REPO: msys2-ci-base-i686
21 x86_64:
22 MSYS_DIR: msys64
23 BASE_REPO: msys2-ci-base
24 steps:
25 - script: |
26 git clone https://github.com/msys2/$(BASE_REPO).git %CD:~0,2%\$(MSYS_DIR)
27 displayName: 'Install MSYS2'
28 - script: |
29 set PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
30 %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm -Syyuu
31 displayName: 'Update MSYS2'
32 - script: |
33 set PATH=%CD:~0,2%\$(MSYS_DIR)\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
34 %CD:~0,2%\$(MSYS_DIR)\usr\bin\pacman --noconfirm --needed -S make gcc bison diffutils openssl-devel
35 displayName: 'Install Toolchain'
36 - script: |
37 set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
38 echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
39 %CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "bash build-tools.sh"
40 displayName: 'Build Host Tools'
41 env:
42 # Tell MSYS2 we need a POSIX emulation layer
43 MSYSTEM: MSYS
44 # Tell MSYS2 not to ‘cd’ our startup directory to HOME
45 CHERE_INVOKING: yes
Bin Mengddaa6b12019-10-28 07:25:03 -070046
47 - job: cppcheck
48 displayName: 'Static code analysis with cppcheck'
49 pool:
50 vmImage: $(ubuntu_vm)
51 container:
52 image: $(ci_runner_image)
53 options: $(container_option)
54 steps:
55 - script: cppcheck --force --quiet --inline-suppr .
56
57 - job: todo
58 displayName: 'Search for TODO within source tree'
59 pool:
60 vmImage: $(ubuntu_vm)
61 container:
62 image: $(ci_runner_image)
63 options: $(container_option)
64 steps:
65 - script: grep -r TODO .
66 - script: grep -r FIXME .
67 - script: grep -r HACK . | grep -v HACKKIT
68
69 - job: sloccount
70 displayName: 'Some statistics about the code base'
71 pool:
72 vmImage: $(ubuntu_vm)
73 container:
74 image: $(ci_runner_image)
75 options: $(container_option)
76 steps:
77 - script: sloccount .
78
79 - job: maintainers
80 displayName: 'Ensure all configs have MAINTAINERS entries'
81 pool:
82 vmImage: $(ubuntu_vm)
83 container:
84 image: $(ci_runner_image)
85 options: $(container_option)
86 steps:
87 - script: |
88 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
89
90 - job: tools_only
91 displayName: 'Ensure host tools build'
92 pool:
93 vmImage: $(ubuntu_vm)
94 container:
95 image: $(ci_runner_image)
96 options: $(container_option)
97 steps:
98 - script: |
99 make tools-only_config tools-only -j$(nproc)
100
101 - job: envtools
102 displayName: 'Ensure env tools build'
103 pool:
104 vmImage: $(ubuntu_vm)
105 container:
106 image: $(ci_runner_image)
107 options: $(container_option)
108 steps:
109 - script: |
110 make tools-only_config envtools -j$(nproc)
111
112 - job: utils
113 displayName: 'Run binman, buildman, dtoc and patman testsuites'
114 pool:
115 vmImage: $(ubuntu_vm)
116 steps:
117 - script: |
118 cat << EOF > build.sh
119 set -ex
120 cd ${WORK_DIR}
121 EOF
122 cat << "EOF" >> build.sh
123 git config --global user.name "Azure Pipelines"
124 git config --global user.email bmeng.cn@gmail.com
125 export USER=azure
126 virtualenv /tmp/venv
127 . /tmp/venv/bin/activate
128 pip install pyelftools
129 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl
130 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
131 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
132 ./tools/buildman/buildman -o /tmp -P sandbox_spl
133 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
134 ./tools/buildman/buildman -t
135 ./tools/dtoc/dtoc -t
136 ./tools/patman/patman --test
137 EOF
138 cat build.sh
139 # We cannot use "container" like other jobs above, as buildman
140 # seems to hang forever with pre-configured "container" environment
141 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
142
143 - job: test_py
144 displayName: 'test.py'
145 pool:
146 vmImage: $(ubuntu_vm)
147 strategy:
148 matrix:
149 sandbox:
150 TEST_PY_BD: "sandbox"
151 BUILDMAN: "^sandbox$"
152 sandbox_spl:
153 TEST_PY_BD: "sandbox_spl"
154 TEST_PY_TEST_SPEC: "test_ofplatdata"
155 BUILDMAN: "^sandbox_spl$"
156 sandbox_flattree:
157 TEST_PY_BD: "sandbox_flattree"
158 BUILDMAN: "^sandbox_flattree$"
159 evb_ast2500:
160 TEST_PY_BD: "evb-ast2500"
161 TEST_PY_ID: "--id qemu"
162 BUILDMAN: "^evb-ast2500$"
163 vexpress_ca15_tc2:
164 TEST_PY_BD: "vexpress_ca15_tc2"
165 TEST_PY_ID: "--id qemu"
166 BUILDMAN: "^vexpress_ca15_tc2$"
167 vexpress_ca9x4:
168 TEST_PY_BD: "vexpress_ca9x4"
169 TEST_PY_ID: "--id qemu"
170 BUILDMAN: "^vexpress_ca9x4$"
171 integratorcp_cm926ejs:
172 TEST_PY_BD: "integratorcp_cm926ejs"
173 TEST_PY_ID: "--id qemu"
174 TEST_PY_TEST_SPEC: "not sleep"
175 BUILDMAN: "^integratorcp_cm926ejs$"
176 qemu_arm:
177 TEST_PY_BD: "qemu_arm"
178 TEST_PY_TEST_SPEC: "not sleep"
179 BUILDMAN: "^qemu_arm$"
180 qemu_arm64:
181 TEST_PY_BD: "qemu_arm64"
182 TEST_PY_TEST_SPEC: "not sleep"
183 BUILDMAN: "^qemu_arm64$"
184 qemu_mips:
185 TEST_PY_BD: "qemu_mips"
186 TEST_PY_TEST_SPEC: "not sleep"
187 BUILDMAN: "^qemu_mips$"
188 qemu_mipsel:
189 TEST_PY_BD: "qemu_mipsel"
190 TEST_PY_TEST_SPEC: "not sleep"
191 BUILDMAN: "^qemu_mipsel$"
192 qemu_mips64:
193 TEST_PY_BD: "qemu_mips64"
194 TEST_PY_TEST_SPEC: "not sleep"
195 BUILDMAN: "^qemu_mips64$"
196 qemu_mips64el:
197 TEST_PY_BD: "qemu_mips64el"
198 TEST_PY_TEST_SPEC: "not sleep"
199 BUILDMAN: "^qemu_mips64el$"
200 qemu_ppce500:
201 TEST_PY_BD: "qemu-ppce500"
202 TEST_PY_TEST_SPEC: "not sleep"
203 BUILDMAN: "^qemu-ppce500$"
204 qemu_riscv64:
205 TEST_PY_BD: "qemu-riscv64"
206 TEST_PY_TEST_SPEC: "not sleep"
207 BUILDMAN: "^qemu-riscv64$"
208 qemu_x86:
209 TEST_PY_BD: "qemu-x86"
210 TEST_PY_TEST_SPEC: "not sleep"
211 BUILDMAN: "^qemu-x86$"
212 qemu_x86_64:
213 TEST_PY_BD: "qemu-x86_64"
214 TEST_PY_TEST_SPEC: "not sleep"
215 BUILDMAN: "^qemu-x86_64$"
216 zynq_zc702:
217 TEST_PY_BD: "zynq_zc702"
218 TEST_PY_ID: "--id qemu"
219 TEST_PY_TEST_SPEC: "not sleep"
220 BUILDMAN: "^zynq_zc702$"
221 xilinx_versal_virt:
222 TEST_PY_BD: "xilinx_versal_virt"
223 TEST_PY_ID: "--id qemu"
224 TEST_PY_TEST_SPEC: "not sleep"
225 BUILDMAN: "^xilinx_versal_virt$"
226 xtfpga:
227 TEST_PY_BD: "xtfpga"
228 TEST_PY_ID: "--id qemu"
229 TEST_PY_TEST_SPEC: "not sleep"
230 BUILDMAN: "^xtfpga$"
231 steps:
232 - script: |
233 cat << EOF > test.sh
234 set -ex
235 # make environment variables available as tests are running inside a container
236 export WORK_DIR="${WORK_DIR}"
237 export TEST_PY_BD="${TEST_PY_BD}"
238 export TEST_PY_ID="${TEST_PY_ID}"
239 export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
240 export BUILDMAN="${BUILDMAN}"
241 EOF
242 cat << "EOF" >> test.sh
243 # the below corresponds to .gitlab-ci.yml "before_script"
244 cd ${WORK_DIR}
245 git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
246 ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
247 ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
Bin Mengddaa6b12019-10-28 07:25:03 -0700248 grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
249 grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
250 mkdir ~/grub2-arm
251 cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di
252 mkdir ~/grub2-arm64
253 cd ~/grub2-arm64; wget -O - http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm | rpm2cpio | cpio -di
254 # the below corresponds to .gitlab-ci.yml "script"
255 cd ${WORK_DIR}
256 if [[ "${BUILDMAN}" != "" ]]; then
257 ret=0;
258 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE} || ret=$?;
259 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
260 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
261 exit $ret;
262 fi;
263 fi
Tom Rini17e41f22019-10-31 10:45:03 -0400264 virtualenv -p /usr/bin/python3 /tmp/venv
265 . /tmp/venv/bin/activate
266 pip install -r test/py/requirements.txt
Bin Mengddaa6b12019-10-28 07:25:03 -0700267 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
Tom Rini528facb2019-11-01 13:59:14 -0400268 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Bin Mengddaa6b12019-10-28 07:25:03 -0700269 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
270 if [[ "${TEST_PY_BD}" != "" ]]; then
271 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
272 ret=$?;
273 if [[ $ret -ne 0 ]]; then
274 exit $ret;
275 fi;
276 fi
277 # the below corresponds to .gitlab-ci.yml "after_script"
278 rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
279 EOF
280 cat test.sh
281 # make current directory writeable to uboot user inside the container
282 # as sandbox testing need create files like spi flash images, etc.
283 # (TODO: clean up this in the future)
284 chmod 777 .
285 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
286
287 - job: build_the_world
288 displayName: 'Build the World'
289 pool:
290 vmImage: $(ubuntu_vm)
291 strategy:
292 # Use almost the same target division in .travis.yml, only merged
293 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
294 matrix:
295 arc_microblaze_nds32_xtensa:
296 BUILDMAN: "arc microblaze nds32 xtensa"
297 arm11_arm7_arm920t_arm946es:
298 BUILDMAN: "arm11 arm7 arm920t arm946es"
299 arm926ejs:
300 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
301 at91_non_armv7:
302 BUILDMAN: "at91 -x armv7"
303 at91_non_arm926ejs:
304 BUILDMAN: "at91 -x arm926ejs"
305 boundary_engicam_toradex:
306 BUILDMAN: "boundary engicam toradex"
307 arm_bcm:
308 BUILDMAN: "bcm -x mips"
309 nxp_arm32:
310 BUILDMAN: "freescale -x powerpc,m68k,aarch64"
311 nxp_aarch64_ls101x:
312 BUILDMAN: "freescale&aarch64&ls101"
313 nxp_aarch64_ls102x:
314 BUILDMAN: "freescale&aarch64&ls102"
315 nxp_aarch64_ls104x:
316 BUILDMAN: "freescale&aarch64&ls104"
317 nxp_aarch64_ls108x:
318 BUILDMAN: "freescale&aarch64&ls108"
319 nxp_aarch64_ls20xx:
320 BUILDMAN: "freescale&aarch64&ls20"
321 nxp_aarch64_lx216x:
322 BUILDMAN: "freescale&aarch64&lx216"
323 imx6:
324 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
325 imx:
326 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
327 keystone2_keystone3:
328 BUILDMAN: "k2 k3"
329 samsung_socfpga:
330 BUILDMAN: "samsung socfpga"
331 spear:
332 BUILDMAN: "spear"
333 sun4i:
334 BUILDMAN: "sun4i"
335 sun5i:
336 BUILDMAN: "sun5i"
337 sun6i:
338 BUILDMAN: "sun6i"
339 sun7i:
340 BUILDMAN: "sun7i"
341 sun8i_32bit:
342 BUILDMAN: "sun8i&armv7"
343 sun8i_64bit:
344 BUILDMAN: "sun8i&aarch64"
345 sun9i:
346 BUILDMAN: "sun9i"
347 sun50i:
348 BUILDMAN: "sun50i"
349 arm_catch_all:
350 BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rockchip,toradex,socfpga,k2,k3,zynq"
351 sandbox_x86:
352 BUILDMAN: "sandbox x86"
353 technexion:
354 BUILDMAN: "technexion"
355 kirkwood:
356 BUILDMAN: "kirkwood"
357 mvebu:
358 BUILDMAN: "mvebu"
359 m68k:
360 BUILDMAN: "m68k"
361 mips:
362 BUILDMAN: "mips"
363 non_fsl_ppc:
364 BUILDMAN: "powerpc -x freescale"
365 mpc85xx_freescale:
366 BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
367 t208xrdb_corenet_ds:
368 BUILDMAN: "t208xrdb corenet_ds"
369 fsl_ppc:
370 BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
371 t102x:
372 BUILDMAN: "t102*"
373 p1_p2_rdb_pc:
374 BUILDMAN: "p1_p2_rdb_pc"
375 p1010rdb_bsc91:
376 BUILDMAN: "p1010rdb bsc91"
377 siemens:
378 BUILDMAN: "siemens"
379 tegra:
380 BUILDMAN: "tegra -x toradex"
381 am33xx_no_siemens:
382 BUILDMAN: "am33xx -x siemens"
383 omap:
384 BUILDMAN: "omap"
385 uniphier:
386 BUILDMAN: "uniphier"
387 aarch64_catch_all:
388 BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,mvebu,uniphier,sunxi,samsung,rockchip,versal,zynq"
389 rockchip:
390 BUILDMAN: "rockchip"
391 sh:
392 BUILDMAN: "sh -x arm"
393 zynq:
394 BUILDMAN: "zynq&armv7"
395 zynqmp_versal:
396 BUILDMAN: "versal|zynqmp&aarch64"
397 riscv:
398 BUILDMAN: "riscv"
399 steps:
400 - script: |
401 cat << EOF > build.sh
402 set -ex
403 cd ${WORK_DIR}
404 # make environment variables available as tests are running inside a container
405 export BUILDMAN="${BUILDMAN}"
406 EOF
407 cat << "EOF" >> build.sh
408 if [[ "${BUILDMAN}" != "" ]]; then
409 ret=0;
410 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE} || ret=$?;
411 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
412 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
413 exit $ret;
414 fi;
415 fi
416 EOF
417 cat build.sh
418 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh