2 windows_vm: windows-2019
3 ubuntu_vm: ubuntu-18.04
5 ci_runner_image: trini/u-boot-gitlab-ci-runner:focal-20211006-14Nov2021
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.
13 - job: tools_only_windows
14 displayName: 'Ensure host tools build for Windows'
16 vmImage: $(windows_vm)
19 (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")
20 displayName: 'Install MSYS2'
22 sfx.exe -y -o%CD:~0,2%\
23 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syyuu"
24 displayName: 'Update MSYS2'
26 %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -Sy make gcc bison flex diffutils openssl-devel"
27 displayName: 'Install Toolchain'
29 echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
30 %CD:~0,2%\msys64\usr\bin\bash -lc "bash build-tools.sh"
31 displayName: 'Build Host Tools'
33 # Tell MSYS2 we need a POSIX emulation layer
35 # Tell MSYS2 not to ‘cd’ our startup directory to HOME
38 - job: tools_only_macOS
39 displayName: 'Ensure host tools build for macOS X'
43 - script: brew install make
44 displayName: Brew install dependencies
46 gmake tools-only_config tools-only NO_SDL=1 \
49 -j$(sysctl -n hw.logicalcpu)
50 displayName: 'Perform tools-only build'
52 - job: check_for_migrated_symbols_in_board_header
53 displayName: 'Check for migrated symbols in board header'
57 image: $(ci_runner_image)
58 options: $(container_option)
63 cat `find . -name "Kconfig*"` | \
64 sed -n -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
65 -e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
67 for CFG in `find include/configs -name "*.h"`; do
68 grep '#define[[:blank:]]CONFIG_' $CFG | \
69 sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' | \
70 sort -u > ${KUSEDLST} || true
71 NUM=`comm -12 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | \
73 if [[ $NUM -ne 0 ]]; then
74 echo "Unmigrated symbols found in $CFG"
80 displayName: 'Static code analysis with cppcheck'
84 image: $(ci_runner_image)
85 options: $(container_option)
87 - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
90 displayName: 'Build HTML documentation'
94 image: $(ci_runner_image)
95 options: $(container_option)
98 virtualenv -p /usr/bin/python3 /tmp/venvhtml
99 . /tmp/venvhtml/bin/activate
100 pip install -r doc/sphinx/requirements.txt
104 displayName: 'Search for TODO within source tree'
106 vmImage: $(ubuntu_vm)
108 image: $(ci_runner_image)
109 options: $(container_option)
111 - script: grep -r TODO .
112 - script: grep -r FIXME .
113 - script: grep -r HACK . | grep -v HACKKIT
116 displayName: 'Some statistics about the code base'
118 vmImage: $(ubuntu_vm)
120 image: $(ci_runner_image)
121 options: $(container_option)
123 - script: sloccount .
126 displayName: 'Ensure all configs have MAINTAINERS entries'
128 vmImage: $(ubuntu_vm)
130 image: $(ci_runner_image)
131 options: $(container_option)
134 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
137 displayName: 'Ensure host tools build'
139 vmImage: $(ubuntu_vm)
141 image: $(ci_runner_image)
142 options: $(container_option)
145 make tools-only_config tools-only -j$(nproc)
148 displayName: 'Ensure env tools build'
150 vmImage: $(ubuntu_vm)
152 image: $(ci_runner_image)
153 options: $(container_option)
156 make tools-only_config envtools -j$(nproc)
159 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
161 vmImage: $(ubuntu_vm)
164 cat << EOF > build.sh
168 cat << "EOF" >> build.sh
169 git config --global user.name "Azure Pipelines"
172 virtualenv -p /usr/bin/python3 /tmp/venv
173 . /tmp/venv/bin/activate
174 pip install -r test/py/requirements.txt
175 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
176 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
177 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
178 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl
179 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
180 ./tools/buildman/buildman -t
182 ./tools/patman/patman test
183 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
186 # We cannot use "container" like other jobs above, as buildman
187 # seems to hang forever with pre-configured "container" environment
188 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
190 - job: nokia_rx51_test
191 displayName: 'Run tests for Nokia RX-51 (aka N900)'
193 vmImage: $(ubuntu_vm)
195 image: $(ci_runner_image)
196 options: $(container_option)
199 export PATH=/opt/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin:$PATH
200 test/nokia_rx51_test.sh
203 displayName: 'test.py'
205 vmImage: $(ubuntu_vm)
209 TEST_PY_BD: "sandbox"
211 TEST_PY_BD: "sandbox"
212 OVERRIDE: "-O clang-13"
214 TEST_PY_BD: "sandbox_spl"
215 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
217 TEST_PY_BD: "sandbox_noinst"
218 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
220 TEST_PY_BD: "sandbox_flattree"
222 TEST_PY_BD: "evb-ast2500"
223 TEST_PY_ID: "--id qemu"
225 TEST_PY_BD: "vexpress_ca9x4"
226 TEST_PY_ID: "--id qemu"
227 integratorcp_cm926ejs:
228 TEST_PY_BD: "integratorcp_cm926ejs"
229 TEST_PY_ID: "--id qemu"
230 TEST_PY_TEST_SPEC: "not sleep"
232 TEST_PY_BD: "qemu_arm"
233 TEST_PY_TEST_SPEC: "not sleep"
235 TEST_PY_BD: "qemu_arm64"
236 TEST_PY_TEST_SPEC: "not sleep"
239 TEST_PY_ID: "--id qemu"
240 TEST_PY_TEST_SPEC: "not sleep and not efi"
242 TEST_PY_BD: "maltael"
243 TEST_PY_ID: "--id qemu"
244 TEST_PY_TEST_SPEC: "not sleep and not efi"
246 TEST_PY_BD: "malta64"
247 TEST_PY_ID: "--id qemu"
248 TEST_PY_TEST_SPEC: "not sleep and not efi"
250 TEST_PY_BD: "malta64el"
251 TEST_PY_ID: "--id qemu"
252 TEST_PY_TEST_SPEC: "not sleep and not efi"
254 TEST_PY_BD: "qemu-ppce500"
255 TEST_PY_TEST_SPEC: "not sleep"
257 TEST_PY_BD: "qemu-riscv32"
258 TEST_PY_TEST_SPEC: "not sleep"
260 TEST_PY_BD: "qemu-riscv64"
261 TEST_PY_TEST_SPEC: "not sleep"
263 TEST_PY_BD: "qemu-riscv32_spl"
264 TEST_PY_TEST_SPEC: "not sleep"
266 TEST_PY_BD: "qemu-riscv64_spl"
267 TEST_PY_TEST_SPEC: "not sleep"
269 TEST_PY_BD: "qemu-x86"
270 TEST_PY_TEST_SPEC: "not sleep"
272 TEST_PY_BD: "qemu-x86_64"
273 TEST_PY_TEST_SPEC: "not sleep"
275 TEST_PY_BD: "r2dplus"
276 TEST_PY_ID: "--id i82557c_qemu"
278 TEST_PY_BD: "r2dplus"
279 TEST_PY_ID: "--id pcnet_qemu"
281 TEST_PY_BD: "r2dplus"
282 TEST_PY_ID: "--id rtl8139_qemu"
284 TEST_PY_BD: "r2dplus"
285 TEST_PY_ID: "--id tulip_qemu"
286 sifive_unleashed_sdcard:
287 TEST_PY_BD: "sifive_unleashed"
288 TEST_PY_ID: "--id sdcard_qemu"
289 sifive_unleashed_spi-nor:
290 TEST_PY_BD: "sifive_unleashed"
291 TEST_PY_ID: "--id spi-nor_qemu"
293 TEST_PY_BD: "xilinx_zynq_virt"
294 TEST_PY_ID: "--id qemu"
295 TEST_PY_TEST_SPEC: "not sleep"
297 TEST_PY_BD: "xilinx_versal_virt"
298 TEST_PY_ID: "--id qemu"
299 TEST_PY_TEST_SPEC: "not sleep"
302 TEST_PY_ID: "--id qemu"
303 TEST_PY_TEST_SPEC: "not sleep"
308 # make environment variables available as tests are running inside a container
309 export WORK_DIR="${WORK_DIR}"
310 export TEST_PY_BD="${TEST_PY_BD}"
311 export TEST_PY_ID="${TEST_PY_ID}"
312 export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
313 export OVERRIDE="${OVERRIDE}"
315 cat << "EOF" >> test.sh
316 # the below corresponds to .gitlab-ci.yml "before_script"
318 git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
319 ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
320 ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
321 grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
322 grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
323 if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
324 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
325 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
327 if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
328 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
329 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
331 # the below corresponds to .gitlab-ci.yml "script"
333 export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD};
334 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE}
335 cp ~/grub_x86.efi ${UBOOT_TRAVIS_BUILD_DIR}/
336 cp ~/grub_x64.efi ${UBOOT_TRAVIS_BUILD_DIR}/
337 cp /opt/grub/grubriscv64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
338 cp /opt/grub/grubaa64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
339 cp /opt/grub/grubarm.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
340 # create sdcard / spi-nor images for sifive unleashed using genimage
341 if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
343 cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
344 cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
346 genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
347 cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
349 genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
350 cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
352 virtualenv -p /usr/bin/python3 /tmp/venv
353 . /tmp/venv/bin/activate
354 pip install -r test/py/requirements.txt
355 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
356 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
357 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
358 ./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";
359 # the below corresponds to .gitlab-ci.yml "after_script"
360 rm -rf /tmp/uboot-test-hooks /tmp/venv
363 # make current directory writeable to uboot user inside the container
364 # as sandbox testing need create files like spi flash images, etc.
365 # (TODO: clean up this in the future)
367 # Filesystem tests need extra docker args to run
369 if [[ "${TEST_PY_BD}" == "sandbox" ]]; then
370 # mount -o loop needs the loop devices
371 if modprobe loop; then
372 for d in $(find /dev -maxdepth 1 -name 'loop*'); do
373 set -- "$@" --device $d:$d
376 # Needed for mount syscall (for guestmount as well)
377 set -- "$@" --cap-add SYS_ADMIN
378 # Default apparmor profile denies mounts
379 set -- "$@" --security-opt apparmor=unconfined
381 # Some tests using libguestfs-tools need the fuse device to run
382 docker run "$@" --device /dev/fuse:/dev/fuse -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
384 - job: build_the_world
385 displayName: 'Build the World'
387 vmImage: $(ubuntu_vm)
389 # Use almost the same target division in .travis.yml, only merged
390 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
392 arc_microblaze_nds32_xtensa:
393 BUILDMAN: "arc microblaze nds32 xtensa"
394 arm11_arm7_arm920t_arm946es:
395 BUILDMAN: "arm11 arm7 arm920t arm946es"
397 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,omap"
399 BUILDMAN: "at91 -x armv7"
401 BUILDMAN: "at91 -x arm926ejs"
402 boundary_engicam_toradex:
403 BUILDMAN: "boundary engicam toradex"
405 BUILDMAN: "bcm -x mips"
407 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
409 BUILDMAN: "freescale&ls101"
411 BUILDMAN: "freescale&ls102"
413 BUILDMAN: "freescale&ls104"
415 BUILDMAN: "freescale&ls108"
417 BUILDMAN: "freescale&ls20"
419 BUILDMAN: "freescale&lx216"
421 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
423 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
429 BUILDMAN: "samsung socfpga"
439 BUILDMAN: "sun8i&armv7"
441 BUILDMAN: "sun8i&aarch64"
447 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"
449 BUILDMAN: "sandbox x86"
451 BUILDMAN: "technexion"
461 BUILDMAN: "powerpc -x freescale"
463 BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x bsc91*"
465 BUILDMAN: "t208xrdb corenet_ds"
467 BUILDMAN: "mpc83xx&freescale"
471 BUILDMAN: "p1_p2_rdb_pc"
473 BUILDMAN: "p1010rdb bsc91"
477 BUILDMAN: "tegra -x toradex"
479 BUILDMAN: "am33xx -x siemens"
485 BUILDMAN: "aarch64 -x bcm,imx8,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq"
491 BUILDMAN: "zynq&armv7"
493 BUILDMAN: "versal|zynqmp&aarch64"
498 cat << EOF > build.sh
501 # make environment variables available as tests are running inside a container
502 export BUILDMAN="${BUILDMAN}"
504 cat << "EOF" >> build.sh
505 if [[ "${BUILDMAN}" != "" ]]; then
507 tools/buildman/buildman -o /tmp -P -E -W ${BUILDMAN} ${OVERRIDE} || ret=$?;
508 if [[ $ret -ne 0 ]]; then
509 tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
515 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh