2 windows_vm: windows-2019
3 ubuntu_vm: ubuntu-22.04
5 ci_runner_image: trini/u-boot-gitlab-ci-runner:jammy-20221130-11Jan2023
6 # Add '-u 0' options for Azure pipelines, otherwise we get "permission
7 # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer",
8 # since our $(ci_runner_image) user is not root.
15 - job: tools_only_windows
16 displayName: 'Ensure host tools build for Windows'
18 vmImage: $(windows_vm)
21 (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-06-04/msys2-base-x86_64-20210604.sfx.exe", "sfx.exe")
22 displayName: 'Install MSYS2'
24 sfx.exe -y -o%CD:~0,2%\
25 %CD:~0,2%\msys64\usr\bin\bash -lc " "
26 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
27 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
28 displayName: 'Update MSYS2'
30 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -Sy make gcc bison flex diffutils openssl-devel libgnutls-devel libutil-linux-devel"
31 displayName: 'Install Toolchain'
33 echo make tools-only_defconfig tools-only > build-tools.sh
34 %CD:~0,2%\msys64\usr\bin\bash -lc "bash build-tools.sh"
35 displayName: 'Build Host Tools'
37 # Tell MSYS2 we need a POSIX emulation layer
39 # Tell MSYS2 not to ‘cd’ our startup directory to HOME
42 - job: tools_only_macOS
43 displayName: 'Ensure host tools build for macOS X'
47 - script: brew install make ossp-uuid
48 displayName: Brew install dependencies
50 gmake tools-only_config tools-only \
51 HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \
52 HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \
53 -j$(sysctl -n hw.logicalcpu)
54 displayName: 'Perform tools-only build'
56 - job: check_for_new_CONFIG_symbols_outside_Kconfig
57 displayName: 'Check for new CONFIG symbols outside Kconfig'
61 image: $(ci_runner_image)
62 options: $(container_option)
64 # If grep succeeds and finds a match the test fails as we should
66 - script: git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_'
67 include/configs `find arch -name config.h` && exit 1 || exit 0
70 displayName: 'Static code analysis with cppcheck'
74 image: $(ci_runner_image)
75 options: $(container_option)
77 - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
80 displayName: 'Build documentation'
84 image: $(ci_runner_image)
85 options: $(container_option)
88 virtualenv -p /usr/bin/python3 /tmp/venvhtml
89 . /tmp/venvhtml/bin/activate
90 pip install -r doc/sphinx/requirements.txt
95 displayName: 'Search for TODO within source tree'
99 image: $(ci_runner_image)
100 options: $(container_option)
102 - script: grep -r TODO .
103 - script: grep -r FIXME .
104 - script: grep -r HACK . | grep -v HACKKIT
107 displayName: 'Some statistics about the code base'
109 vmImage: $(ubuntu_vm)
111 image: $(ci_runner_image)
112 options: $(container_option)
114 - script: sloccount .
117 displayName: 'Ensure all configs have MAINTAINERS entries'
119 vmImage: $(ubuntu_vm)
121 image: $(ci_runner_image)
122 options: $(container_option)
125 ./tools/buildman/buildman -R
128 displayName: 'Ensure host tools build'
130 vmImage: $(ubuntu_vm)
132 image: $(ci_runner_image)
133 options: $(container_option)
136 make tools-only_config tools-only -j$(nproc)
139 displayName: 'Ensure env tools build'
141 vmImage: $(ubuntu_vm)
143 image: $(ci_runner_image)
144 options: $(container_option)
147 make tools-only_config envtools -j$(nproc)
150 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
152 vmImage: $(ubuntu_vm)
155 cat << "EOF" > build.sh
157 git config --global user.name "Azure Pipelines"
158 git config --global user.email bmeng.cn@gmail.com
159 git config --global --add safe.directory $(work_dir)
161 virtualenv -p /usr/bin/python3 /tmp/venv
162 . /tmp/venv/bin/activate
163 pip install -r test/py/requirements.txt
164 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
165 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
166 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
167 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl
169 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
170 ./tools/buildman/buildman -t
172 ./tools/patman/patman test
173 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
176 # We cannot use "container" like other jobs above, as buildman
177 # seems to hang forever with pre-configured "container" environment
178 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
180 - job: nokia_rx51_test
181 displayName: 'Run tests for Nokia RX-51 (aka N900)'
183 vmImage: $(ubuntu_vm)
185 image: $(ci_runner_image)
186 options: $(container_option)
189 export PATH=/opt/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin:$PATH
190 test/nokia_rx51_test.sh
193 displayName: Check for any pylint regressions
195 vmImage: $(ubuntu_vm)
197 image: $(ci_runner_image)
198 options: $(container_option)
201 git config --global --add safe.directory $(work_dir)
203 pip install -r test/py/requirements.txt
204 pip install asteval pylint==2.12.2 pyopenssl
205 export PATH=${PATH}:~/.local/bin
206 echo "[MASTER]" >> .pylintrc
207 echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
208 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
209 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl
212 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
218 displayName: 'test.py'
220 vmImage: $(ubuntu_vm)
224 TEST_PY_BD: "sandbox"
226 TEST_PY_BD: "sandbox"
227 OVERRIDE: "-O clang-14"
229 TEST_PY_BD: "sandbox"
230 BUILD_ENV: "NO_LTO=1"
232 TEST_PY_BD: "sandbox_spl"
233 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
235 TEST_PY_BD: "sandbox_vpl"
236 TEST_PY_TEST_SPEC: "test_vpl_help or test_spl"
238 TEST_PY_BD: "sandbox_noinst"
239 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
241 TEST_PY_BD: "sandbox_flattree"
243 TEST_PY_BD: "coreboot"
244 TEST_PY_ID: "--id qemu"
245 TEST_PY_TEST_SPEC: "not sleep"
247 TEST_PY_BD: "evb-ast2500"
248 TEST_PY_ID: "--id qemu"
250 TEST_PY_BD: "evb-ast2600"
251 TEST_PY_ID: "--id qemu"
253 TEST_PY_BD: "vexpress_ca9x4"
254 TEST_PY_ID: "--id qemu"
255 integratorcp_cm926ejs:
256 TEST_PY_BD: "integratorcp_cm926ejs"
257 TEST_PY_ID: "--id qemu"
258 TEST_PY_TEST_SPEC: "not sleep"
260 TEST_PY_BD: "qemu_arm"
261 TEST_PY_TEST_SPEC: "not sleep"
263 TEST_PY_BD: "qemu_arm64"
264 TEST_PY_TEST_SPEC: "not sleep"
267 TEST_PY_ID: "--id qemu"
268 TEST_PY_TEST_SPEC: "not sleep and not efi"
270 TEST_PY_BD: "maltael"
271 TEST_PY_ID: "--id qemu"
272 TEST_PY_TEST_SPEC: "not sleep and not efi"
274 TEST_PY_BD: "malta64"
275 TEST_PY_ID: "--id qemu"
276 TEST_PY_TEST_SPEC: "not sleep and not efi"
278 TEST_PY_BD: "malta64el"
279 TEST_PY_ID: "--id qemu"
280 TEST_PY_TEST_SPEC: "not sleep and not efi"
282 TEST_PY_BD: "qemu-ppce500"
283 TEST_PY_TEST_SPEC: "not sleep"
285 TEST_PY_BD: "qemu-riscv32"
286 TEST_PY_TEST_SPEC: "not sleep"
288 TEST_PY_BD: "qemu-riscv64"
289 TEST_PY_TEST_SPEC: "not sleep"
291 TEST_PY_BD: "qemu-riscv32_spl"
292 TEST_PY_TEST_SPEC: "not sleep"
294 TEST_PY_BD: "qemu-riscv64_spl"
295 TEST_PY_TEST_SPEC: "not sleep"
297 TEST_PY_BD: "qemu-x86"
298 TEST_PY_TEST_SPEC: "not sleep"
300 TEST_PY_BD: "qemu-x86_64"
301 TEST_PY_TEST_SPEC: "not sleep"
303 TEST_PY_BD: "r2dplus"
304 TEST_PY_ID: "--id i82557c_qemu"
306 TEST_PY_BD: "r2dplus"
307 TEST_PY_ID: "--id pcnet_qemu"
309 TEST_PY_BD: "r2dplus"
310 TEST_PY_ID: "--id rtl8139_qemu"
312 TEST_PY_BD: "r2dplus"
313 TEST_PY_ID: "--id tulip_qemu"
314 sifive_unleashed_sdcard:
315 TEST_PY_BD: "sifive_unleashed"
316 TEST_PY_ID: "--id sdcard_qemu"
317 sifive_unleashed_spi-nor:
318 TEST_PY_BD: "sifive_unleashed"
319 TEST_PY_ID: "--id spi-nor_qemu"
321 TEST_PY_BD: "xilinx_zynq_virt"
322 TEST_PY_ID: "--id qemu"
323 TEST_PY_TEST_SPEC: "not sleep"
325 TEST_PY_BD: "xilinx_versal_virt"
326 TEST_PY_ID: "--id qemu"
327 TEST_PY_TEST_SPEC: "not sleep"
330 TEST_PY_ID: "--id qemu"
331 TEST_PY_TEST_SPEC: "not sleep"
336 # make environment variables available as tests are running inside a container
337 export WORK_DIR="${WORK_DIR}"
338 export TEST_PY_BD="${TEST_PY_BD}"
339 export TEST_PY_ID="${TEST_PY_ID}"
340 export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
341 export OVERRIDE="${OVERRIDE}"
342 export BUILD_ENV="${BUILD_ENV}"
344 cat << "EOF" >> test.sh
345 # the below corresponds to .gitlab-ci.yml "before_script"
347 git config --global --add safe.directory ${WORK_DIR}
348 git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
349 ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
350 ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
351 grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
352 grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
353 if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
354 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
355 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
357 if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
358 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
359 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
361 # the below corresponds to .gitlab-ci.yml "script"
363 export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD};
364 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE}
365 cp ~/grub_x86.efi ${UBOOT_TRAVIS_BUILD_DIR}/
366 cp ~/grub_x64.efi ${UBOOT_TRAVIS_BUILD_DIR}/
367 cp /opt/grub/grubriscv64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
368 cp /opt/grub/grubaa64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
369 cp /opt/grub/grubarm.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
370 # create sdcard / spi-nor images for sifive unleashed using genimage
371 if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
373 cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
374 cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
376 genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
377 cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
379 genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
380 cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
382 if [[ "${TEST_PY_BD}" == "coreboot" ]]; then
383 wget -O - "https://drive.google.com/uc?id=1x6nrtWIyIRPLS2cQBwYTnT2TbOI8UjmM&export=download" |xz -dc >${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom;
384 wget -O - "https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=download" >cbfstool;
386 ./cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
388 virtualenv -p /usr/bin/python3 /tmp/venv
389 . /tmp/venv/bin/activate
390 pip install -r test/py/requirements.txt
391 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
392 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
393 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
394 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
395 # the below corresponds to .gitlab-ci.yml "after_script"
396 rm -rf /tmp/uboot-test-hooks /tmp/venv
399 # make current directory writeable to uboot user inside the container
400 # as sandbox testing need create files like spi flash images, etc.
401 # (TODO: clean up this in the future)
403 # Filesystem tests need extra docker args to run
405 if [[ "${TEST_PY_BD}" == "sandbox" ]]; then
406 # mount -o loop needs the loop devices
407 if modprobe loop; then
408 for d in $(find /dev -maxdepth 1 -name 'loop*'); do
409 set -- "$@" --device $d:$d
412 # Needed for mount syscall (for guestmount as well)
413 set -- "$@" --cap-add SYS_ADMIN
414 # Default apparmor profile denies mounts
415 set -- "$@" --security-opt apparmor=unconfined
417 # Some tests using libguestfs-tools need the fuse device to run
418 docker run "$@" --device /dev/fuse:/dev/fuse -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
422 - job: build_the_world
423 displayName: 'Build the World'
425 vmImage: $(ubuntu_vm)
427 # Use almost the same target division in .travis.yml, only merged
428 # 3 small build jobs (arc/microblaze/xtensa) into one.
430 arc_microblaze_xtensa:
431 BUILDMAN: "arc microblaze xtensa"
434 arm11_arm7_arm920t_arm946es:
435 BUILDMAN: "arm11 arm7 arm920t arm946es"
437 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,omap"
439 BUILDMAN: "at91 -x armv7"
441 BUILDMAN: "at91 -x arm926ejs"
442 boundary_engicam_toradex:
443 BUILDMAN: "boundary engicam toradex"
445 BUILDMAN: "bcm -x mips"
447 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
449 BUILDMAN: "freescale&ls101"
451 BUILDMAN: "freescale&ls102"
453 BUILDMAN: "freescale&ls104"
455 BUILDMAN: "freescale&ls108"
457 BUILDMAN: "freescale&ls20"
459 BUILDMAN: "freescale&lx216"
461 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
463 BUILDMAN: "mx -x mx6,imx8,freescale,technexion,toradex"
465 BUILDMAN: "imx8 imx9"
473 OVERRIDE: "-O clang-14 -a ASAN"
475 BUILDMAN: "samsung socfpga"
485 BUILDMAN: "sun8i&armv7"
487 BUILDMAN: "sun8i&aarch64"
493 BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,renesas,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq"
495 BUILDMAN: "sandbox x86"
497 BUILDMAN: "technexion"
511 BUILDMAN: "tegra -x toradex"
513 BUILDMAN: "am33xx -x siemens"
519 BUILDMAN: "aarch64 -x amlogic,bcm,imx8,imx9,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq"
521 BUILDMAN: "rk -x aarch64"
523 BUILDMAN: "rk&aarch64"
527 BUILDMAN: "zynq&armv7"
529 BUILDMAN: "versal|zynqmp&aarch64"
534 cat << EOF > build.sh
537 # make environment variables available as tests are running inside a container
538 export BUILDMAN="${BUILDMAN}"
539 git config --global --add safe.directory ${WORK_DIR}
541 cat << "EOF" >> build.sh
542 if [[ "${BUILDMAN}" != "" ]]; then
544 tools/buildman/buildman -o /tmp -PEWM ${BUILDMAN} ${OVERRIDE} || ret=$?;
545 if [[ $ret -ne 0 ]]; then
546 tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
552 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh