1 # SPDX-License-Identifier: GPL-2.0+
5 DEFAULT_ARM64_TAG: "arm64"
6 DEFAULT_AMD64_TAG: "amd64"
7 DEFAULT_FAST_AMD64_TAG: "fast amd64"
8 MIRROR_DOCKER: docker.io
10 PLATFORM: linux/amd64,linux/arm64
20 # Grab our configured image. The source for this is found
21 # in the u-boot tree at tools/docker/Dockerfile
22 image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20240911.1-08Dec2024
24 # We run some tests in different order, to catch some failures quicker.
31 .buildman_and_testpy_template: &buildman_and_testpy_dfn
33 retry: 2 # QEMU may be too slow, etc.
34 needs: [ "Run binman, buildman, dtoc, Kconfig and patman testsuites" ]
36 # Clone uboot-test-hooks
37 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
38 - git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
39 # qemu_arm64_lwip_defconfig is the same as qemu_arm64 but with NET_LWIP enabled.
40 # The test config and the boardenv file from qemu_arm64 can be re-used so create symlinks
41 - ln -s conf.qemu_arm64_na /tmp/uboot-test-hooks/bin/travis-ci/conf.qemu_arm64_lwip_na
42 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
43 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
44 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
45 wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
46 export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
48 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
49 wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
50 export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
52 - if [[ "${TEST_PY_BD}" == "qemu-arm-sbsa" ]]; then
53 wget -O /tmp/bl1.bin https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/latest/tf-a/bl1.bin;
54 wget -O /tmp/fip.bin https://artifacts.codelinaro.org/artifactory/linaro-419-sbsa-ref/latest/tf-a/fip.bin;
55 export BINMAN_INDIRS=/tmp;
59 - cp -v /tmp/${TEST_PY_BD}/*.{html,css,xml} .
60 - rm -rf /tmp/uboot-test-hooks /tmp/venv
62 # If we've been asked to use clang only do one configuration.
63 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
64 - echo BUILD_ENV ${BUILD_ENV}
65 - if [ -n "${BUILD_ENV}" ]; then
68 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
69 --board ${TEST_PY_BD} ${OVERRIDE}
70 - cp /opt/grub/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
71 - cp /opt/grub/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
72 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
73 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
74 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
75 # create sdcard / spi-nor images for sifive unleashed using genimage
76 - if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
78 cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
79 cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
81 genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
82 cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
84 genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
85 cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
87 - if [[ "${TEST_PY_BD}" == "coreboot" ]]; then
88 cp /opt/coreboot/coreboot.rom ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom;
89 /opt/coreboot/cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom remove -n fallback/payload;
90 /opt/coreboot/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;
92 - virtualenv -p /usr/bin/python3 /tmp/venv
93 - . /tmp/venv/bin/activate
94 - pip install -r test/py/requirements.txt
95 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
96 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
97 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
98 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
99 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
100 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
101 --junitxml=/tmp/${TEST_PY_BD}/results.xml
111 build all platforms in a single job:
122 git config --global --add safe.directory "${CI_PROJECT_DIR}";
123 pip install -r tools/buildman/requirements.txt;
124 ./tools/buildman/buildman -o /tmp -PEWM -x xtensa || ret=$?;
125 if [[ $ret -ne 0 ]]; then
126 ./tools/buildman/buildman -o /tmp -seP;
133 check for new CONFIG symbols outside Kconfig:
136 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
137 # If grep succeeds and finds a match the test fails as we should
139 - git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_'
140 :^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
141 :^include/linux/kconfig.h :^tools/ :^dts/upstream/
142 :^lib/mbedtls/external :^lib/mbedtls/mbedtls_def_config.h &&
145 # build documentation
149 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
150 - . /tmp/venvhtml/bin/activate
151 - pip install -r doc/sphinx/requirements.txt
152 - make htmldocs KDOC_WERROR=1
155 # ensure all configs have MAINTAINERS entries
156 Check for configs without MAINTAINERS entry:
159 - ./tools/buildman/buildman --maintainer-check
161 # Ensure host tools build
162 Build tools-only and envtools:
165 - make tools-only_config tools-only -j$(nproc);
167 make tools-only_config envtools -j$(nproc)
169 Run binman, buildman, dtoc, Kconfig and patman testsuites:
172 - ${DEFAULT_AMD64_TAG}
174 - git config --global user.name "GitLab CI Runner";
176 git config --global --add safe.directory "${CI_PROJECT_DIR}";
178 virtualenv -p /usr/bin/python3 /tmp/venv;
179 . /tmp/venv/bin/activate;
180 pip install -r test/py/requirements.txt;
181 pip install -r tools/buildman/requirements.txt;
182 export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only;
183 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
184 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
186 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
189 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
190 ./tools/buildman/buildman -t;
191 ./tools/dtoc/dtoc -t;
192 ./tools/patman/patman test;
195 # Check for any pylint regressions
199 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
200 - pip install -r test/py/requirements.txt
201 - pip install -r tools/buildman/requirements.txt
202 - pip install asteval pylint==2.12.2 pyopenssl
203 - export PATH=${PATH}:~/.local/bin
204 - echo "[MASTER]" >> .pylintrc
205 - echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
206 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/tools-only
208 - ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
212 - export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
215 # Check for pre-schema driver model tags
216 Check for pre-schema tags:
219 - git config --global --add safe.directory "${CI_PROJECT_DIR}";
220 # If grep succeeds and finds a match the test fails as we should
222 - git grep u-boot,dm- -- '*.dts*' && exit 1 || exit 0
224 # Check we can package the Python tools
225 Check packing of Python tools:
230 # Test sandbox with test.py
233 - ${DEFAULT_AMD64_TAG}
235 TEST_PY_BD: "sandbox"
236 <<: *buildman_and_testpy_dfn
238 sandbox with clang test.py:
240 - ${DEFAULT_AMD64_TAG}
242 TEST_PY_BD: "sandbox"
243 OVERRIDE: "-O clang-17"
244 <<: *buildman_and_testpy_dfn
248 - ${DEFAULT_AMD64_TAG}
250 TEST_PY_BD: "sandbox64"
251 <<: *buildman_and_testpy_dfn
253 sandbox64 with clang test.py:
255 - ${DEFAULT_AMD64_TAG}
257 TEST_PY_BD: "sandbox64"
258 OVERRIDE: "-O clang-17"
259 <<: *buildman_and_testpy_dfn
263 TEST_PY_BD: "sandbox_spl"
264 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
265 <<: *buildman_and_testpy_dfn
267 sandbox_noinst_test.py:
269 TEST_PY_BD: "sandbox_noinst"
270 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
271 <<: *buildman_and_testpy_dfn
273 sandbox_noinst with LOAD_FIT_FULL test.py:
275 TEST_PY_BD: "sandbox_noinst"
276 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
277 OVERRIDE: "-a CONFIG_SPL_LOAD_FIT_FULL=y"
278 <<: *buildman_and_testpy_dfn
282 TEST_PY_BD: "sandbox_vpl"
283 TEST_PY_TEST_SPEC: "vpl or test_spl"
284 <<: *buildman_and_testpy_dfn
286 # Enable tracing and disable LTO, to ensure functions are not elided
287 sandbox trace_test.py:
289 TEST_PY_BD: "sandbox"
290 BUILD_ENV: "FTRACE=1 NO_LTO=1"
291 TEST_PY_TEST_SPEC: "trace"
292 OVERRIDE: "-a CONFIG_TRACE=y -a CONFIG_TRACE_EARLY=y -a CONFIG_TRACE_EARLY_SIZE=0x01000000 -a CONFIG_TRACE_BUFFER_SIZE=0x02000000"
293 <<: *buildman_and_testpy_dfn
297 TEST_PY_BD: "evb-ast2500"
298 TEST_PY_TEST_SPEC: "not sleep"
299 TEST_PY_ID: "--id qemu"
300 <<: *buildman_and_testpy_dfn
304 TEST_PY_BD: "evb-ast2600"
305 TEST_PY_TEST_SPEC: "not sleep"
306 TEST_PY_ID: "--id qemu"
307 <<: *buildman_and_testpy_dfn
309 sandbox_flattree test.py:
311 - ${DEFAULT_AMD64_TAG}
313 TEST_PY_BD: "sandbox_flattree"
314 <<: *buildman_and_testpy_dfn
316 vexpress_ca9x4 test.py:
318 TEST_PY_BD: "vexpress_ca9x4"
319 TEST_PY_TEST_SPEC: "not sleep"
320 TEST_PY_ID: "--id qemu"
321 <<: *buildman_and_testpy_dfn
323 integratorcp_cm926ejs test.py:
325 TEST_PY_BD: "integratorcp_cm926ejs"
326 TEST_PY_TEST_SPEC: "not sleep"
327 TEST_PY_ID: "--id qemu"
328 <<: *buildman_and_testpy_dfn
332 TEST_PY_BD: "qemu_arm"
333 TEST_PY_TEST_SPEC: "not sleep"
334 <<: *buildman_and_testpy_dfn
338 TEST_PY_BD: "qemu_arm64"
339 TEST_PY_TEST_SPEC: "not sleep"
340 <<: *buildman_and_testpy_dfn
342 qemu_arm64_lwip test.py:
344 TEST_PY_BD: "qemu_arm64_lwip"
345 TEST_PY_TEST_SPEC: "test_net_dhcp or test_net_ping or test_net_tftpboot"
346 <<: *buildman_and_testpy_dfn
348 qemu_arm_sbsa test.py:
350 TEST_PY_BD: "qemu-arm-sbsa"
351 TEST_PY_TEST_SPEC: "not sleep"
352 <<: *buildman_and_testpy_dfn
356 TEST_PY_BD: "M5208EVBE"
357 TEST_PY_ID: "--id qemu"
358 TEST_PY_TEST_SPEC: "not sleep and not efi"
359 OVERRIDE: "-a CONFIG_M68K_QEMU=y -a ~CONFIG_MCFTMR"
360 <<: *buildman_and_testpy_dfn
365 TEST_PY_TEST_SPEC: "not sleep and not efi"
366 TEST_PY_ID: "--id qemu"
367 <<: *buildman_and_testpy_dfn
369 qemu_maltael test.py:
371 TEST_PY_BD: "maltael"
372 TEST_PY_TEST_SPEC: "not sleep and not efi"
373 TEST_PY_ID: "--id qemu"
374 <<: *buildman_and_testpy_dfn
376 qemu_malta64 test.py:
378 TEST_PY_BD: "malta64"
379 TEST_PY_TEST_SPEC: "not sleep and not efi"
380 TEST_PY_ID: "--id qemu"
381 <<: *buildman_and_testpy_dfn
383 qemu_malta64el test.py:
385 TEST_PY_BD: "malta64el"
386 TEST_PY_TEST_SPEC: "not sleep and not efi"
387 TEST_PY_ID: "--id qemu"
388 <<: *buildman_and_testpy_dfn
390 qemu-ppce500 test.py:
392 TEST_PY_BD: "qemu-ppce500"
393 TEST_PY_TEST_SPEC: "not sleep"
394 <<: *buildman_and_testpy_dfn
396 qemu-riscv32 test.py:
398 TEST_PY_BD: "qemu-riscv32"
399 TEST_PY_TEST_SPEC: "not sleep"
400 <<: *buildman_and_testpy_dfn
402 qemu-riscv64 test.py:
404 TEST_PY_BD: "qemu-riscv64"
405 TEST_PY_TEST_SPEC: "not sleep"
406 <<: *buildman_and_testpy_dfn
408 qemu-riscv32_spl test.py:
410 TEST_PY_BD: "qemu-riscv32_spl"
411 TEST_PY_TEST_SPEC: "not sleep"
412 <<: *buildman_and_testpy_dfn
414 qemu-riscv64_spl test.py:
416 TEST_PY_BD: "qemu-riscv64_spl"
417 TEST_PY_TEST_SPEC: "not sleep"
418 <<: *buildman_and_testpy_dfn
422 TEST_PY_BD: "qemu-x86"
423 TEST_PY_TEST_SPEC: "not sleep"
424 <<: *buildman_and_testpy_dfn
428 TEST_PY_BD: "qemu-x86_64"
429 TEST_PY_TEST_SPEC: "not sleep"
430 <<: *buildman_and_testpy_dfn
432 qemu-xtensa-dc233c test.py:
434 TEST_PY_BD: "qemu-xtensa-dc233c"
435 TEST_PY_TEST_SPEC: "not sleep and not efi"
437 - ${DEFAULT_AMD64_TAG}
438 <<: *buildman_and_testpy_dfn
440 r2dplus_i82557c test.py:
442 TEST_PY_BD: "r2dplus"
443 TEST_PY_TEST_SPEC: "not sleep"
444 TEST_PY_ID: "--id i82557c_qemu"
445 <<: *buildman_and_testpy_dfn
447 r2dplus_pcnet test.py:
449 TEST_PY_BD: "r2dplus"
450 TEST_PY_TEST_SPEC: "not sleep"
451 TEST_PY_ID: "--id pcnet_qemu"
452 <<: *buildman_and_testpy_dfn
454 r2dplus_rtl8139 test.py:
456 TEST_PY_BD: "r2dplus"
457 TEST_PY_TEST_SPEC: "not sleep"
458 TEST_PY_ID: "--id rtl8139_qemu"
459 <<: *buildman_and_testpy_dfn
461 r2dplus_tulip test.py:
463 TEST_PY_BD: "r2dplus"
464 TEST_PY_TEST_SPEC: "not sleep"
465 TEST_PY_ID: "--id tulip_qemu"
466 <<: *buildman_and_testpy_dfn
468 sifive_unleashed_sdcard test.py:
470 TEST_PY_BD: "sifive_unleashed"
471 TEST_PY_TEST_SPEC: "not sleep"
472 TEST_PY_ID: "--id sdcard_qemu"
473 <<: *buildman_and_testpy_dfn
475 sifive_unleashed_spi-nor test.py:
477 TEST_PY_BD: "sifive_unleashed"
478 TEST_PY_TEST_SPEC: "not sleep"
479 TEST_PY_ID: "--id spi-nor_qemu"
480 <<: *buildman_and_testpy_dfn
482 xilinx_zynq_virt test.py:
484 TEST_PY_BD: "xilinx_zynq_virt"
485 TEST_PY_TEST_SPEC: "not sleep"
486 TEST_PY_ID: "--id qemu"
487 <<: *buildman_and_testpy_dfn
489 xilinx_versal_virt test.py:
491 TEST_PY_BD: "xilinx_versal_virt"
492 TEST_PY_TEST_SPEC: "not sleep"
493 TEST_PY_ID: "--id qemu"
494 OVERRIDE: "-a ~CONFIG_USB_DWC3"
495 <<: *buildman_and_testpy_dfn
500 TEST_PY_TEST_SPEC: "not sleep"
501 TEST_PY_ID: "--id qemu"
503 - ${DEFAULT_AMD64_TAG}
504 <<: *buildman_and_testpy_dfn
508 TEST_PY_BD: "coreboot"
509 TEST_PY_TEST_SPEC: "not sleep"
510 TEST_PY_ID: "--id qemu"
511 <<: *buildman_and_testpy_dfn
513 .lab_template: &lab_dfn
516 - if: $SJG_LAB == "1"
518 - if: $SJG_LAB != "1"
524 - if [[ -z "${SJG_LAB}" ]]; then
529 # OUT - output directory for builds
530 - export SRC="$(pwd)"
531 - export OUT="${SRC}/build/${BOARD}"
532 - export PATH=$PATH:~/bin
533 - export PATH=$PATH:/vid/software/devel/ubtest/u-boot-test-hooks/bin
535 # Load it on the device
537 - echo "role ${ROLE}"
538 - export strategy="-s uboot -e off"
539 - export USE_LABGRID_SJG=1
540 # export verbose="-v"
541 - ${SRC}/test/py/test.py --role ${ROLE} --build-dir "${OUT}"
542 --capture=tee-sys -k "not bootstd" || ret=$?
543 - U_BOOT_BOARD_IDENTITY="${ROLE}" u-boot-test-release || true
544 - if [[ $ret -ne 0 ]]; then
550 - "build/${BOARD}/test-log.html"
551 - "build/${BOARD}/multiplexed_log.css"