blob: a95233f1369a40b11726b8cd669022cf22ec5bd9 [file] [log] [blame]
Bin Mengc7072d12019-10-27 05:19:48 -07001variables:
Tom Rinid7c8e592020-01-27 16:23:29 -05002 windows_vm: vs2017-win2016
Bin Mengddaa6b12019-10-28 07:25:03 -07003 ubuntu_vm: ubuntu-18.04
Tom Rini3c396bc2020-04-10 15:53:01 -04004 ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20200311-10Apr2020
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
Heinrich Schuchardtfbf2bf92020-02-21 18:24:02 +010057 - job: htmldocs
58 displayName: 'Build HTML documentation'
59 pool:
60 vmImage: $(ubuntu_vm)
61 container:
62 image: $(ci_runner_image)
63 options: $(container_option)
64 steps:
65 - script: make htmldocs
66
Bin Mengddaa6b12019-10-28 07:25:03 -070067 - job: todo
68 displayName: 'Search for TODO within source tree'
69 pool:
70 vmImage: $(ubuntu_vm)
71 container:
72 image: $(ci_runner_image)
73 options: $(container_option)
74 steps:
75 - script: grep -r TODO .
76 - script: grep -r FIXME .
77 - script: grep -r HACK . | grep -v HACKKIT
78
79 - job: sloccount
80 displayName: 'Some statistics about the code base'
81 pool:
82 vmImage: $(ubuntu_vm)
83 container:
84 image: $(ci_runner_image)
85 options: $(container_option)
86 steps:
87 - script: sloccount .
88
89 - job: maintainers
90 displayName: 'Ensure all configs have MAINTAINERS entries'
91 pool:
92 vmImage: $(ubuntu_vm)
93 container:
94 image: $(ci_runner_image)
95 options: $(container_option)
96 steps:
97 - script: |
98 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
99
100 - job: tools_only
101 displayName: 'Ensure host tools build'
102 pool:
103 vmImage: $(ubuntu_vm)
104 container:
105 image: $(ci_runner_image)
106 options: $(container_option)
107 steps:
108 - script: |
109 make tools-only_config tools-only -j$(nproc)
110
111 - job: envtools
112 displayName: 'Ensure env tools build'
113 pool:
114 vmImage: $(ubuntu_vm)
115 container:
116 image: $(ci_runner_image)
117 options: $(container_option)
118 steps:
119 - script: |
120 make tools-only_config envtools -j$(nproc)
121
122 - job: utils
Tom Rini0b3e0c42020-03-11 18:11:15 -0400123 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
Bin Mengddaa6b12019-10-28 07:25:03 -0700124 pool:
125 vmImage: $(ubuntu_vm)
126 steps:
127 - script: |
128 cat << EOF > build.sh
129 set -ex
130 cd ${WORK_DIR}
131 EOF
132 cat << "EOF" >> build.sh
133 git config --global user.name "Azure Pipelines"
134 git config --global user.email bmeng.cn@gmail.com
135 export USER=azure
Tom Rini6c883102020-02-11 12:41:14 -0500136 virtualenv -p /usr/bin/python3 /tmp/venv
Bin Mengddaa6b12019-10-28 07:25:03 -0700137 . /tmp/venv/bin/activate
Tom Rini0b3e0c42020-03-11 18:11:15 -0400138 pip install pyelftools pytest
Simon Glass9e589c02020-03-18 09:42:50 -0600139 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
Bin Mengddaa6b12019-10-28 07:25:03 -0700140 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
141 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
Simon Glass9e589c02020-03-18 09:42:50 -0600142 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl
Bin Mengddaa6b12019-10-28 07:25:03 -0700143 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
144 ./tools/buildman/buildman -t
145 ./tools/dtoc/dtoc -t
146 ./tools/patman/patman --test
Tom Rini0b3e0c42020-03-11 18:11:15 -0400147 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
Bin Mengddaa6b12019-10-28 07:25:03 -0700148 EOF
149 cat build.sh
150 # We cannot use "container" like other jobs above, as buildman
151 # seems to hang forever with pre-configured "container" environment
152 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
153
154 - job: test_py
155 displayName: 'test.py'
156 pool:
157 vmImage: $(ubuntu_vm)
158 strategy:
159 matrix:
160 sandbox:
161 TEST_PY_BD: "sandbox"
Tom Rini99a1bb32019-11-06 19:30:47 -0500162 sandbox_clang:
163 TEST_PY_BD: "sandbox"
Tom Rini99a1bb32019-11-06 19:30:47 -0500164 OVERRIDE: "-O clang-7"
Bin Mengddaa6b12019-10-28 07:25:03 -0700165 sandbox_spl:
166 TEST_PY_BD: "sandbox_spl"
167 TEST_PY_TEST_SPEC: "test_ofplatdata"
Bin Mengddaa6b12019-10-28 07:25:03 -0700168 sandbox_flattree:
169 TEST_PY_BD: "sandbox_flattree"
Bin Mengddaa6b12019-10-28 07:25:03 -0700170 evb_ast2500:
171 TEST_PY_BD: "evb-ast2500"
172 TEST_PY_ID: "--id qemu"
Bin Mengddaa6b12019-10-28 07:25:03 -0700173 vexpress_ca15_tc2:
174 TEST_PY_BD: "vexpress_ca15_tc2"
175 TEST_PY_ID: "--id qemu"
Bin Mengddaa6b12019-10-28 07:25:03 -0700176 vexpress_ca9x4:
177 TEST_PY_BD: "vexpress_ca9x4"
178 TEST_PY_ID: "--id qemu"
Bin Mengddaa6b12019-10-28 07:25:03 -0700179 integratorcp_cm926ejs:
180 TEST_PY_BD: "integratorcp_cm926ejs"
181 TEST_PY_ID: "--id qemu"
182 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700183 qemu_arm:
184 TEST_PY_BD: "qemu_arm"
185 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700186 qemu_arm64:
187 TEST_PY_BD: "qemu_arm64"
188 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700189 qemu_mips:
190 TEST_PY_BD: "qemu_mips"
191 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700192 qemu_mipsel:
193 TEST_PY_BD: "qemu_mipsel"
194 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700195 qemu_mips64:
196 TEST_PY_BD: "qemu_mips64"
197 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700198 qemu_mips64el:
199 TEST_PY_BD: "qemu_mips64el"
200 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700201 qemu_ppce500:
202 TEST_PY_BD: "qemu-ppce500"
203 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengaeb3ea42020-03-28 07:25:27 -0700204 qemu_riscv32:
205 TEST_PY_BD: "qemu-riscv32"
206 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700207 qemu_riscv64:
208 TEST_PY_BD: "qemu-riscv64"
209 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700210 qemu_riscv32_spl:
211 TEST_PY_BD: "qemu-riscv32_spl"
212 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700213 qemu_riscv64_spl:
214 TEST_PY_BD: "qemu-riscv64_spl"
215 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700216 qemu_x86:
217 TEST_PY_BD: "qemu-x86"
218 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700219 qemu_x86_64:
220 TEST_PY_BD: "qemu-x86_64"
221 TEST_PY_TEST_SPEC: "not sleep"
Michal Simekf8834fd2020-02-13 15:03:29 +0100222 xilinx_zynq_virt:
223 TEST_PY_BD: "xilinx_zynq_virt"
Bin Mengddaa6b12019-10-28 07:25:03 -0700224 TEST_PY_ID: "--id qemu"
225 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700226 xilinx_versal_virt:
227 TEST_PY_BD: "xilinx_versal_virt"
228 TEST_PY_ID: "--id qemu"
229 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700230 xtfpga:
231 TEST_PY_BD: "xtfpga"
232 TEST_PY_ID: "--id qemu"
233 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengddaa6b12019-10-28 07:25:03 -0700234 steps:
235 - script: |
236 cat << EOF > test.sh
237 set -ex
238 # make environment variables available as tests are running inside a container
239 export WORK_DIR="${WORK_DIR}"
240 export TEST_PY_BD="${TEST_PY_BD}"
241 export TEST_PY_ID="${TEST_PY_ID}"
242 export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
Tom Rini99a1bb32019-11-06 19:30:47 -0500243 export OVERRIDE="${OVERRIDE}"
Bin Mengddaa6b12019-10-28 07:25:03 -0700244 EOF
245 cat << "EOF" >> test.sh
246 # the below corresponds to .gitlab-ci.yml "before_script"
247 cd ${WORK_DIR}
248 git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
249 ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
250 ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
Bin Mengddaa6b12019-10-28 07:25:03 -0700251 grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
252 grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
Tom Rini6d4656b2020-02-07 11:45:55 -0500253 cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
Bin Mengaeb3ea42020-03-28 07:25:27 -0700254 cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
Tom Rini6d4656b2020-02-07 11:45:55 -0500255 cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
256 cp /opt/grub/grubarm.efi ~/grub_arm.efi
Bin Mengb68d9d62020-03-28 07:25:29 -0700257 if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
258 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv32-bin.tar.xz | tar -C /tmp -xJ;
259 export OPENSBI=/tmp/opensbi-0.6-rv32-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
260 fi
261 if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
262 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv64-bin.tar.xz | tar -C /tmp -xJ;
263 export OPENSBI=/tmp/opensbi-0.6-rv64-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
264 fi
Bin Mengddaa6b12019-10-28 07:25:03 -0700265 # the below corresponds to .gitlab-ci.yml "script"
266 cd ${WORK_DIR}
Simon Glass41e8fbe2020-03-18 09:42:52 -0600267 if [[ "${TEST_PY_BD}" != "" ]]; then
Bin Mengddaa6b12019-10-28 07:25:03 -0700268 ret=0;
Simon Glass41e8fbe2020-03-18 09:42:52 -0600269 tools/buildman/buildman -o /tmp -P -E --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?;
Bin Mengddaa6b12019-10-28 07:25:03 -0700270 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -0600271 tools/buildman/buildman -o /tmp -seP --board ${TEST_PY_BD};
Bin Mengddaa6b12019-10-28 07:25:03 -0700272 exit $ret;
273 fi;
274 fi
Tom Rini17e41f22019-10-31 10:45:03 -0400275 virtualenv -p /usr/bin/python3 /tmp/venv
276 . /tmp/venv/bin/activate
277 pip install -r test/py/requirements.txt
Bin Mengddaa6b12019-10-28 07:25:03 -0700278 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
Tom Rini528facb2019-11-01 13:59:14 -0400279 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Bin Mengddaa6b12019-10-28 07:25:03 -0700280 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
281 if [[ "${TEST_PY_BD}" != "" ]]; then
282 ./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";
283 ret=$?;
284 if [[ $ret -ne 0 ]]; then
285 exit $ret;
286 fi;
287 fi
288 # the below corresponds to .gitlab-ci.yml "after_script"
Tom Rini6d4656b2020-02-07 11:45:55 -0500289 rm -rf /tmp/uboot-test-hooks /tmp/venv
Bin Mengddaa6b12019-10-28 07:25:03 -0700290 EOF
291 cat test.sh
292 # make current directory writeable to uboot user inside the container
293 # as sandbox testing need create files like spi flash images, etc.
294 # (TODO: clean up this in the future)
295 chmod 777 .
296 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
297
298 - job: build_the_world
299 displayName: 'Build the World'
300 pool:
301 vmImage: $(ubuntu_vm)
302 strategy:
303 # Use almost the same target division in .travis.yml, only merged
304 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
305 matrix:
306 arc_microblaze_nds32_xtensa:
307 BUILDMAN: "arc microblaze nds32 xtensa"
308 arm11_arm7_arm920t_arm946es:
309 BUILDMAN: "arm11 arm7 arm920t arm946es"
310 arm926ejs:
311 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
312 at91_non_armv7:
313 BUILDMAN: "at91 -x armv7"
314 at91_non_arm926ejs:
315 BUILDMAN: "at91 -x arm926ejs"
316 boundary_engicam_toradex:
317 BUILDMAN: "boundary engicam toradex"
318 arm_bcm:
319 BUILDMAN: "bcm -x mips"
320 nxp_arm32:
Heiko Schocher56b9b312019-11-22 11:17:29 +0100321 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
322 nxp_ls101x:
323 BUILDMAN: "freescale&ls101"
324 nxp_ls102x:
325 BUILDMAN: "freescale&ls102"
326 nxp_ls104x:
327 BUILDMAN: "freescale&ls104"
328 nxp_ls108x:
329 BUILDMAN: "freescale&ls108"
330 nxp_ls20xx:
331 BUILDMAN: "freescale&ls20"
332 nxp_lx216x:
333 BUILDMAN: "freescale&lx216"
Bin Mengddaa6b12019-10-28 07:25:03 -0700334 imx6:
335 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
336 imx:
337 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
338 keystone2_keystone3:
339 BUILDMAN: "k2 k3"
340 samsung_socfpga:
341 BUILDMAN: "samsung socfpga"
342 spear:
343 BUILDMAN: "spear"
344 sun4i:
345 BUILDMAN: "sun4i"
346 sun5i:
347 BUILDMAN: "sun5i"
348 sun6i:
349 BUILDMAN: "sun6i"
350 sun7i:
351 BUILDMAN: "sun7i"
352 sun8i_32bit:
353 BUILDMAN: "sun8i&armv7"
354 sun8i_64bit:
355 BUILDMAN: "sun8i&aarch64"
356 sun9i:
357 BUILDMAN: "sun9i"
358 sun50i:
359 BUILDMAN: "sun50i"
360 arm_catch_all:
Tom Rinie289a162020-03-09 13:01:57 -0400361 BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq"
Bin Mengddaa6b12019-10-28 07:25:03 -0700362 sandbox_x86:
363 BUILDMAN: "sandbox x86"
364 technexion:
365 BUILDMAN: "technexion"
366 kirkwood:
367 BUILDMAN: "kirkwood"
368 mvebu:
369 BUILDMAN: "mvebu"
370 m68k:
371 BUILDMAN: "m68k"
372 mips:
373 BUILDMAN: "mips"
374 non_fsl_ppc:
375 BUILDMAN: "powerpc -x freescale"
376 mpc85xx_freescale:
377 BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
378 t208xrdb_corenet_ds:
379 BUILDMAN: "t208xrdb corenet_ds"
380 fsl_ppc:
381 BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
382 t102x:
383 BUILDMAN: "t102*"
384 p1_p2_rdb_pc:
385 BUILDMAN: "p1_p2_rdb_pc"
386 p1010rdb_bsc91:
387 BUILDMAN: "p1010rdb bsc91"
388 siemens:
389 BUILDMAN: "siemens"
390 tegra:
391 BUILDMAN: "tegra -x toradex"
392 am33xx_no_siemens:
393 BUILDMAN: "am33xx -x siemens"
394 omap:
395 BUILDMAN: "omap"
396 uniphier:
397 BUILDMAN: "uniphier"
398 aarch64_catch_all:
Tom Rinie289a162020-03-09 13:01:57 -0400399 BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
Bin Mengddaa6b12019-10-28 07:25:03 -0700400 rockchip:
Tom Rinie289a162020-03-09 13:01:57 -0400401 BUILDMAN: "rk"
Bin Mengddaa6b12019-10-28 07:25:03 -0700402 sh:
403 BUILDMAN: "sh -x arm"
404 zynq:
405 BUILDMAN: "zynq&armv7"
406 zynqmp_versal:
407 BUILDMAN: "versal|zynqmp&aarch64"
408 riscv:
409 BUILDMAN: "riscv"
410 steps:
411 - script: |
412 cat << EOF > build.sh
413 set -ex
414 cd ${WORK_DIR}
415 # make environment variables available as tests are running inside a container
416 export BUILDMAN="${BUILDMAN}"
417 EOF
418 cat << "EOF" >> build.sh
419 if [[ "${BUILDMAN}" != "" ]]; then
420 ret=0;
421 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE} || ret=$?;
422 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -0600423 tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
Bin Mengddaa6b12019-10-28 07:25:03 -0700424 exit $ret;
425 fi;
426 fi
427 EOF
428 cat build.sh
429 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh