1 # SPDX-License-Identifier: GPL-2.0+
5 MIRROR_DOCKER: docker.io
11 # Grab our configured image. The source for this is found
12 # in the u-boot tree at tools/docker/Dockerfile
13 image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20230308-04Apr2023
15 # We run some tests in different order, to catch some failures quicker.
21 .buildman_and_testpy_template: &buildman_and_testpy_dfn
24 # Clone uboot-test-hooks
25 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
26 - git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
27 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
28 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
29 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
30 - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
31 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
32 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
33 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
35 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
36 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
37 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
41 - cp -v /tmp/${TEST_PY_BD}/*.{html,css} .
42 - rm -rf /tmp/uboot-test-hooks /tmp/venv
44 # If we've been asked to use clang only do one configuration.
45 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
46 - echo BUILD_ENV ${BUILD_ENV}
47 - if [ -n "${BUILD_ENV}" ]; then
50 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
51 --board ${TEST_PY_BD} ${OVERRIDE}
52 - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
53 - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
54 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
55 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
56 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
57 # create sdcard / spi-nor images for sifive unleashed using genimage
58 - if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
60 cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
61 cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
63 genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
64 cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
66 genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
67 cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
69 - if [[ "${TEST_PY_BD}" == "coreboot" ]]; then
71 "https://drive.google.com/uc?id=1x6nrtWIyIRPLS2cQBwYTnT2TbOI8UjmM&export=download" |
72 xz -dc >${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom;
74 "https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=download" >
77 ./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;
79 - virtualenv -p /usr/bin/python3 /tmp/venv
80 - . /tmp/venv/bin/activate
81 - pip install -r test/py/requirements.txt
82 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
83 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
84 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
85 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
86 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
87 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
95 build all 32bit ARM platforms:
99 git config --global --add safe.directory "${CI_PROJECT_DIR}";
100 ./tools/buildman/buildman -o /tmp -PEWM arm -x aarch64 || ret=$?;
101 if [[ $ret -ne 0 ]]; then
102 ./tools/buildman/buildman -o /tmp -seP;
106 build all 64bit ARM platforms:
109 - virtualenv -p /usr/bin/python3 /tmp/venv
110 - . /tmp/venv/bin/activate
112 git config --global --add safe.directory "${CI_PROJECT_DIR}";
113 ./tools/buildman/buildman -o /tmp -PEWM aarch64 || ret=$?;
114 if [[ $ret -ne 0 ]]; then
115 ./tools/buildman/buildman -o /tmp -seP;
119 build all PowerPC platforms:
123 git config --global --add safe.directory "${CI_PROJECT_DIR}";
124 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
125 if [[ $ret -ne 0 ]]; then
126 ./tools/buildman/buildman -o /tmp -seP;
130 build all other platforms:
134 git config --global --add safe.directory "${CI_PROJECT_DIR}";
135 ./tools/buildman/buildman -o /tmp -PEWM -x arm,powerpc || ret=$?;
136 if [[ $ret -ne 0 ]]; then
137 ./tools/buildman/buildman -o /tmp -seP;
141 check for new CONFIG symbols outside Kconfig:
144 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
145 # If grep succeeds and finds a match the test fails as we should
147 - git grep -E '^#[[:blank:]]*(define|undef)[[:blank:]]*CONFIG_'
148 :^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
149 :^include/linux/kconfig.h :^tools/ && exit 1 || exit 0
151 # QA jobs for code analytics
152 # static code analysis with cppcheck (we can add --enable=all later)
156 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
158 # search for TODO within source tree
159 grep TODO/FIXME/HACK:
164 # search for HACK within source tree and ignore HACKKIT board
165 - grep -r HACK . | grep -v HACKKIT
167 # build documentation
171 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
172 - . /tmp/venvhtml/bin/activate
173 - pip install -r doc/sphinx/requirements.txt
177 # some statistics about the code base
183 # ensure all configs have MAINTAINERS entries
184 Check for configs without MAINTAINERS entry:
187 - ./tools/buildman/buildman -R
189 # Ensure host tools build
193 - make tools-only_config tools-only -j$(nproc)
195 # Ensure env tools build
199 - make tools-only_config envtools -j$(nproc)
201 Run binman, buildman, dtoc, Kconfig and patman testsuites:
204 - git config --global user.name "GitLab CI Runner";
206 git config --global --add safe.directory "${CI_PROJECT_DIR}";
208 virtualenv -p /usr/bin/python3 /tmp/venv;
209 . /tmp/venv/bin/activate;
210 pip install -r test/py/requirements.txt;
211 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
212 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
213 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
215 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
218 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
219 ./tools/buildman/buildman -t;
220 ./tools/dtoc/dtoc -t;
221 ./tools/patman/patman test;
224 Run tests for Nokia RX-51 (aka N900):
227 - mkdir nokia_rx51_tmp;
228 ln -s /opt/nokia/u-boot-gen-combined nokia_rx51_tmp/;
229 ln -s /opt/nokia/qemu-n900.tar.gz nokia_rx51_tmp/;
230 ln -s /opt/nokia/kernel_2.6.28-20103103+0m5_armel.deb nokia_rx51_tmp/;
231 ln -s /opt/nokia/libc6_2.5.1-1eglibc27+0m5_armel.deb nokia_rx51_tmp/;
232 ln -s /opt/nokia/busybox_1.10.2.legal-1osso30+0m5_armel.deb nokia_rx51_tmp/;
233 ln -s /opt/nokia/qemu-system-arm nokia_rx51_tmp/;
234 export PATH=/opt/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin:$PATH;
235 test/nokia_rx51_test.sh
237 # Check for any pylint regressions
241 - git config --global --add safe.directory "${CI_PROJECT_DIR}"
242 - pip install -r test/py/requirements.txt
243 - pip install asteval pylint==2.12.2 pyopenssl
244 - export PATH=${PATH}:~/.local/bin
245 - echo "[MASTER]" >> .pylintrc
246 - echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
247 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
249 - ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
253 - export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
256 # Check for pre-schema driver model tags
257 Check for pre-schema tags:
260 - git config --global --add safe.directory "${CI_PROJECT_DIR}";
261 # If grep succeeds and finds a match the test fails as we should
263 - git grep u-boot,dm- -- '*.dts*' && exit 1 || exit 0
265 # Check we can package the Python tools
266 Check packing of Python tools:
271 # Test sandbox with test.py
274 TEST_PY_BD: "sandbox"
275 <<: *buildman_and_testpy_dfn
277 sandbox with clang test.py:
279 TEST_PY_BD: "sandbox"
280 OVERRIDE: "-O clang-16"
281 <<: *buildman_and_testpy_dfn
283 sandbox without LTO test.py:
285 TEST_PY_BD: "sandbox"
286 BUILD_ENV: "NO_LTO=1"
287 <<: *buildman_and_testpy_dfn
291 TEST_PY_BD: "sandbox_spl"
292 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
293 <<: *buildman_and_testpy_dfn
295 sandbox_noinst_test.py:
297 TEST_PY_BD: "sandbox_noinst"
298 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
299 <<: *buildman_and_testpy_dfn
303 TEST_PY_BD: "sandbox_vpl"
304 TEST_PY_TEST_SPEC: "vpl or test_spl"
305 <<: *buildman_and_testpy_dfn
307 # Enable tracing and disable LTO, to ensure functions are not elided
308 sandbox trace_test.py:
310 TEST_PY_BD: "sandbox"
311 BUILD_ENV: "FTRACE=1 NO_LTO=1"
312 TEST_PY_TEST_SPEC: "trace"
313 OVERRIDE: "-a CONFIG_TRACE=y -a CONFIG_TRACE_EARLY=y -a CONFIG_TRACE_EARLY_SIZE=0x01000000"
314 <<: *buildman_and_testpy_dfn
318 TEST_PY_BD: "evb-ast2500"
319 TEST_PY_ID: "--id qemu"
320 <<: *buildman_and_testpy_dfn
324 TEST_PY_BD: "evb-ast2600"
325 TEST_PY_ID: "--id qemu"
326 <<: *buildman_and_testpy_dfn
328 sandbox_flattree test.py:
330 TEST_PY_BD: "sandbox_flattree"
331 <<: *buildman_and_testpy_dfn
333 vexpress_ca9x4 test.py:
335 TEST_PY_BD: "vexpress_ca9x4"
336 TEST_PY_ID: "--id qemu"
337 <<: *buildman_and_testpy_dfn
339 integratorcp_cm926ejs test.py:
341 TEST_PY_BD: "integratorcp_cm926ejs"
342 TEST_PY_TEST_SPEC: "not sleep"
343 TEST_PY_ID: "--id qemu"
344 <<: *buildman_and_testpy_dfn
348 TEST_PY_BD: "qemu_arm"
349 TEST_PY_TEST_SPEC: "not sleep"
350 <<: *buildman_and_testpy_dfn
354 TEST_PY_BD: "qemu_arm64"
355 TEST_PY_TEST_SPEC: "not sleep"
356 <<: *buildman_and_testpy_dfn
361 TEST_PY_TEST_SPEC: "not sleep and not efi"
362 TEST_PY_ID: "--id qemu"
363 <<: *buildman_and_testpy_dfn
365 qemu_maltael test.py:
367 TEST_PY_BD: "maltael"
368 TEST_PY_TEST_SPEC: "not sleep and not efi"
369 TEST_PY_ID: "--id qemu"
370 <<: *buildman_and_testpy_dfn
372 qemu_malta64 test.py:
374 TEST_PY_BD: "malta64"
375 TEST_PY_TEST_SPEC: "not sleep and not efi"
376 TEST_PY_ID: "--id qemu"
377 <<: *buildman_and_testpy_dfn
379 qemu_malta64el test.py:
381 TEST_PY_BD: "malta64el"
382 TEST_PY_TEST_SPEC: "not sleep and not efi"
383 TEST_PY_ID: "--id qemu"
384 <<: *buildman_and_testpy_dfn
386 qemu-ppce500 test.py:
388 TEST_PY_BD: "qemu-ppce500"
389 TEST_PY_TEST_SPEC: "not sleep"
390 <<: *buildman_and_testpy_dfn
392 qemu-riscv32 test.py:
394 TEST_PY_BD: "qemu-riscv32"
395 TEST_PY_TEST_SPEC: "not sleep"
396 <<: *buildman_and_testpy_dfn
398 qemu-riscv64 test.py:
400 TEST_PY_BD: "qemu-riscv64"
401 TEST_PY_TEST_SPEC: "not sleep"
402 <<: *buildman_and_testpy_dfn
404 qemu-riscv32_spl test.py:
406 TEST_PY_BD: "qemu-riscv32_spl"
407 TEST_PY_TEST_SPEC: "not sleep"
408 <<: *buildman_and_testpy_dfn
410 qemu-riscv64_spl test.py:
412 TEST_PY_BD: "qemu-riscv64_spl"
413 TEST_PY_TEST_SPEC: "not sleep"
414 <<: *buildman_and_testpy_dfn
418 TEST_PY_BD: "qemu-x86"
419 TEST_PY_TEST_SPEC: "not sleep"
420 <<: *buildman_and_testpy_dfn
424 TEST_PY_BD: "qemu-x86_64"
425 TEST_PY_TEST_SPEC: "not sleep"
426 <<: *buildman_and_testpy_dfn
428 r2dplus_i82557c test.py:
430 TEST_PY_BD: "r2dplus"
431 TEST_PY_ID: "--id i82557c_qemu"
432 <<: *buildman_and_testpy_dfn
434 r2dplus_pcnet test.py:
436 TEST_PY_BD: "r2dplus"
437 TEST_PY_ID: "--id pcnet_qemu"
438 <<: *buildman_and_testpy_dfn
440 r2dplus_rtl8139 test.py:
442 TEST_PY_BD: "r2dplus"
443 TEST_PY_ID: "--id rtl8139_qemu"
444 <<: *buildman_and_testpy_dfn
446 r2dplus_tulip test.py:
448 TEST_PY_BD: "r2dplus"
449 TEST_PY_ID: "--id tulip_qemu"
450 <<: *buildman_and_testpy_dfn
452 sifive_unleashed_sdcard test.py:
454 TEST_PY_BD: "sifive_unleashed"
455 TEST_PY_ID: "--id sdcard_qemu"
456 <<: *buildman_and_testpy_dfn
458 sifive_unleashed_spi-nor test.py:
460 TEST_PY_BD: "sifive_unleashed"
461 TEST_PY_ID: "--id spi-nor_qemu"
462 <<: *buildman_and_testpy_dfn
464 xilinx_zynq_virt test.py:
466 TEST_PY_BD: "xilinx_zynq_virt"
467 TEST_PY_TEST_SPEC: "not sleep"
468 TEST_PY_ID: "--id qemu"
469 <<: *buildman_and_testpy_dfn
471 xilinx_versal_virt test.py:
473 TEST_PY_BD: "xilinx_versal_virt"
474 TEST_PY_TEST_SPEC: "not sleep"
475 TEST_PY_ID: "--id qemu"
476 <<: *buildman_and_testpy_dfn
481 TEST_PY_TEST_SPEC: "not sleep"
482 TEST_PY_ID: "--id qemu"
483 <<: *buildman_and_testpy_dfn
487 TEST_PY_BD: "coreboot"
488 TEST_PY_TEST_SPEC: "not sleep"
489 TEST_PY_ID: "--id qemu"
490 <<: *buildman_and_testpy_dfn