2 windows_vm: vs2017-win2016
3 ubuntu_vm: ubuntu-18.04
5 ci_runner_image: trini/u-boot-gitlab-ci-runner:focal-20210921-05Oct2021
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'
53 displayName: 'Static code analysis with cppcheck'
57 image: $(ci_runner_image)
58 options: $(container_option)
60 - script: cppcheck -j$(nproc) --force --quiet --inline-suppr .
63 displayName: 'Build HTML documentation'
67 image: $(ci_runner_image)
68 options: $(container_option)
71 virtualenv -p /usr/bin/python3 /tmp/venvhtml
72 . /tmp/venvhtml/bin/activate
73 pip install -r doc/sphinx/requirements.txt
77 displayName: 'Search for TODO within source tree'
81 image: $(ci_runner_image)
82 options: $(container_option)
84 - script: grep -r TODO .
85 - script: grep -r FIXME .
86 - script: grep -r HACK . | grep -v HACKKIT
89 displayName: 'Some statistics about the code base'
93 image: $(ci_runner_image)
94 options: $(container_option)
99 displayName: 'Ensure all configs have MAINTAINERS entries'
101 vmImage: $(ubuntu_vm)
103 image: $(ci_runner_image)
104 options: $(container_option)
107 if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
110 displayName: 'Ensure host tools build'
112 vmImage: $(ubuntu_vm)
114 image: $(ci_runner_image)
115 options: $(container_option)
118 make tools-only_config tools-only -j$(nproc)
121 displayName: 'Ensure env tools build'
123 vmImage: $(ubuntu_vm)
125 image: $(ci_runner_image)
126 options: $(container_option)
129 make tools-only_config envtools -j$(nproc)
132 displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites'
134 vmImage: $(ubuntu_vm)
137 cat << EOF > build.sh
141 cat << "EOF" >> build.sh
142 git config --global user.name "Azure Pipelines"
145 virtualenv -p /usr/bin/python3 /tmp/venv
146 . /tmp/venv/bin/activate
147 pip install -r test/py/requirements.txt
148 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
149 export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
150 export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
151 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl
152 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
153 ./tools/buildman/buildman -t
155 ./tools/patman/patman test
156 make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig
159 # We cannot use "container" like other jobs above, as buildman
160 # seems to hang forever with pre-configured "container" environment
161 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh
163 - job: nokia_rx51_test
164 displayName: 'Run tests for Nokia RX-51 (aka N900)'
166 vmImage: $(ubuntu_vm)
168 image: $(ci_runner_image)
169 options: $(container_option)
172 ./tools/buildman/buildman --fetch-arch arm
173 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH
174 test/nokia_rx51_test.sh
177 displayName: 'test.py'
179 vmImage: $(ubuntu_vm)
183 TEST_PY_BD: "sandbox"
185 TEST_PY_BD: "sandbox"
186 OVERRIDE: "-O clang-13"
188 TEST_PY_BD: "sandbox_spl"
189 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
191 TEST_PY_BD: "sandbox_noinst"
192 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
194 TEST_PY_BD: "sandbox_flattree"
196 TEST_PY_BD: "evb-ast2500"
197 TEST_PY_ID: "--id qemu"
199 TEST_PY_BD: "vexpress_ca9x4"
200 TEST_PY_ID: "--id qemu"
201 integratorcp_cm926ejs:
202 TEST_PY_BD: "integratorcp_cm926ejs"
203 TEST_PY_ID: "--id qemu"
204 TEST_PY_TEST_SPEC: "not sleep"
206 TEST_PY_BD: "qemu_arm"
207 TEST_PY_TEST_SPEC: "not sleep"
209 TEST_PY_BD: "qemu_arm64"
210 TEST_PY_TEST_SPEC: "not sleep"
213 TEST_PY_ID: "--id qemu"
214 TEST_PY_TEST_SPEC: "not sleep and not efi"
216 TEST_PY_BD: "maltael"
217 TEST_PY_ID: "--id qemu"
218 TEST_PY_TEST_SPEC: "not sleep and not efi"
220 TEST_PY_BD: "malta64"
221 TEST_PY_ID: "--id qemu"
222 TEST_PY_TEST_SPEC: "not sleep and not efi"
224 TEST_PY_BD: "malta64el"
225 TEST_PY_ID: "--id qemu"
226 TEST_PY_TEST_SPEC: "not sleep and not efi"
228 TEST_PY_BD: "qemu-ppce500"
229 TEST_PY_TEST_SPEC: "not sleep"
231 TEST_PY_BD: "qemu-riscv32"
232 TEST_PY_TEST_SPEC: "not sleep"
234 TEST_PY_BD: "qemu-riscv64"
235 TEST_PY_TEST_SPEC: "not sleep"
237 TEST_PY_BD: "qemu-riscv32_spl"
238 TEST_PY_TEST_SPEC: "not sleep"
240 TEST_PY_BD: "qemu-riscv64_spl"
241 TEST_PY_TEST_SPEC: "not sleep"
243 TEST_PY_BD: "qemu-x86"
244 TEST_PY_TEST_SPEC: "not sleep"
246 TEST_PY_BD: "qemu-x86_64"
247 TEST_PY_TEST_SPEC: "not sleep"
249 TEST_PY_BD: "r2dplus"
250 TEST_PY_ID: "--id i82557c_qemu"
252 TEST_PY_BD: "r2dplus"
253 TEST_PY_ID: "--id pcnet_qemu"
255 TEST_PY_BD: "r2dplus"
256 TEST_PY_ID: "--id rtl8139_qemu"
258 TEST_PY_BD: "r2dplus"
259 TEST_PY_ID: "--id tulip_qemu"
260 sifive_unleashed_sdcard:
261 TEST_PY_BD: "sifive_unleashed"
262 TEST_PY_ID: "--id sdcard_qemu"
263 sifive_unleashed_spi-nor:
264 TEST_PY_BD: "sifive_unleashed"
265 TEST_PY_ID: "--id spi-nor_qemu"
267 TEST_PY_BD: "xilinx_zynq_virt"
268 TEST_PY_ID: "--id qemu"
269 TEST_PY_TEST_SPEC: "not sleep"
271 TEST_PY_BD: "xilinx_versal_virt"
272 TEST_PY_ID: "--id qemu"
273 TEST_PY_TEST_SPEC: "not sleep"
276 TEST_PY_ID: "--id qemu"
277 TEST_PY_TEST_SPEC: "not sleep"
282 # make environment variables available as tests are running inside a container
283 export WORK_DIR="${WORK_DIR}"
284 export TEST_PY_BD="${TEST_PY_BD}"
285 export TEST_PY_ID="${TEST_PY_ID}"
286 export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}"
287 export OVERRIDE="${OVERRIDE}"
289 cat << "EOF" >> test.sh
290 # the below corresponds to .gitlab-ci.yml "before_script"
292 git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
293 ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
294 ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
295 grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
296 grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
297 if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
298 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
299 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
301 if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
302 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
303 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
305 # the below corresponds to .gitlab-ci.yml "script"
307 export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD};
308 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE}
309 cp ~/grub_x86.efi ${UBOOT_TRAVIS_BUILD_DIR}/
310 cp ~/grub_x64.efi ${UBOOT_TRAVIS_BUILD_DIR}/
311 cp /opt/grub/grubriscv64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
312 cp /opt/grub/grubaa64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
313 cp /opt/grub/grubarm.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
314 # create sdcard / spi-nor images for sifive unleashed using genimage
315 if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
317 cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
318 cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
320 genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
321 cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
323 genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
324 cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
326 virtualenv -p /usr/bin/python3 /tmp/venv
327 . /tmp/venv/bin/activate
328 pip install -r test/py/requirements.txt
329 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
330 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
331 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
332 ./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";
333 # the below corresponds to .gitlab-ci.yml "after_script"
334 rm -rf /tmp/uboot-test-hooks /tmp/venv
337 # make current directory writeable to uboot user inside the container
338 # as sandbox testing need create files like spi flash images, etc.
339 # (TODO: clean up this in the future)
341 # Filesystem tests need extra docker args to run
343 if [[ "${TEST_PY_BD}" == "sandbox" ]]; then
344 # mount -o loop needs the loop devices
345 if modprobe loop; then
346 for d in $(find /dev -maxdepth 1 -name 'loop*'); do
347 set -- "$@" --device $d:$d
350 # Needed for mount syscall (for guestmount as well)
351 set -- "$@" --cap-add SYS_ADMIN
352 # Default apparmor profile denies mounts
353 set -- "$@" --security-opt apparmor=unconfined
355 # Some tests using libguestfs-tools need the fuse device to run
356 docker run "$@" --device /dev/fuse:/dev/fuse -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
358 - job: build_the_world
359 displayName: 'Build the World'
361 vmImage: $(ubuntu_vm)
363 # Use almost the same target division in .travis.yml, only merged
364 # 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
366 arc_microblaze_nds32_xtensa:
367 BUILDMAN: "arc microblaze nds32 xtensa"
368 arm11_arm7_arm920t_arm946es:
369 BUILDMAN: "arm11 arm7 arm920t arm946es"
371 BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,omap"
373 BUILDMAN: "at91 -x armv7"
375 BUILDMAN: "at91 -x arm926ejs"
376 boundary_engicam_toradex:
377 BUILDMAN: "boundary engicam toradex"
379 BUILDMAN: "bcm -x mips"
381 BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216"
383 BUILDMAN: "freescale&ls101"
385 BUILDMAN: "freescale&ls102"
387 BUILDMAN: "freescale&ls104"
389 BUILDMAN: "freescale&ls108"
391 BUILDMAN: "freescale&ls20"
393 BUILDMAN: "freescale&lx216"
395 BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
397 BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
403 BUILDMAN: "samsung socfpga"
413 BUILDMAN: "sun8i&armv7"
415 BUILDMAN: "sun8i&aarch64"
421 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"
423 BUILDMAN: "sandbox x86"
425 BUILDMAN: "technexion"
435 BUILDMAN: "powerpc -x freescale"
437 BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x bsc91*"
439 BUILDMAN: "t208xrdb corenet_ds"
441 BUILDMAN: "mpc83xx&freescale"
445 BUILDMAN: "p1_p2_rdb_pc"
447 BUILDMAN: "p1010rdb bsc91"
451 BUILDMAN: "tegra -x toradex"
453 BUILDMAN: "am33xx -x siemens"
459 BUILDMAN: "aarch64 -x bcm,imx8,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq"
465 BUILDMAN: "zynq&armv7"
467 BUILDMAN: "versal|zynqmp&aarch64"
472 cat << EOF > build.sh
475 # make environment variables available as tests are running inside a container
476 export BUILDMAN="${BUILDMAN}"
478 cat << "EOF" >> build.sh
479 if [[ "${BUILDMAN}" != "" ]]; then
481 tools/buildman/buildman -o /tmp -P -E -W ${BUILDMAN} ${OVERRIDE} || ret=$?;
482 if [[ $ret -ne 0 ]]; then
483 tools/buildman/buildman -o /tmp -seP ${BUILDMAN};
489 docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh