1 # SPDX-License-Identifier: GPL-2.0+
3 # Grab our configured image. The source for this is found at:
4 # https://source.denx.de/u-boot/gitlab-ci-runner
5 image: trini/u-boot-gitlab-ci-runner:focal-20210609-06Jul2021
7 # We run some tests in different order, to catch some failures quicker.
13 .buildman_and_testpy_template: &buildman_and_testpy_dfn
16 # Clone uboot-test-hooks
17 - git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
18 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
19 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
20 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
21 - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
22 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
23 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
24 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
26 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
27 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
28 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
32 - rm -rf /tmp/uboot-test-hooks /tmp/venv
34 # If we've been asked to use clang only do one configuration.
35 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
36 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
37 --board ${TEST_PY_BD} ${OVERRIDE}
38 - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
39 - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
40 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
41 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
42 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
43 - virtualenv -p /usr/bin/python3 /tmp/venv
44 - . /tmp/venv/bin/activate
45 - pip install -r test/py/requirements.txt
46 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
47 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
48 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
49 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
50 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
51 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
53 build all 32bit ARM platforms:
57 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
58 if [[ $ret -ne 0 ]]; then
59 ./tools/buildman/buildman -o /tmp -seP;
63 build all 64bit ARM platforms:
66 - virtualenv -p /usr/bin/python3 /tmp/venv
67 - . /tmp/venv/bin/activate
68 - pip install pyelftools
70 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
71 if [[ $ret -ne 0 ]]; then
72 ./tools/buildman/buildman -o /tmp -seP;
76 build all PowerPC platforms:
80 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
81 if [[ $ret -ne 0 ]]; then
82 ./tools/buildman/buildman -o /tmp -seP;
86 build all other platforms:
90 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
91 if [[ $ret -ne 0 ]]; then
92 ./tools/buildman/buildman -o /tmp -seP;
96 # QA jobs for code analytics
97 # static code analysis with cppcheck (we can add --enable=all later)
101 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
103 # search for TODO within source tree
104 grep TODO/FIXME/HACK:
109 # search for HACK within source tree and ignore HACKKIT board
110 - grep -r HACK . | grep -v HACKKIT
112 # build HTML documentation
116 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
117 - . /tmp/venvhtml/bin/activate
118 - pip install -r doc/sphinx/requirements.txt
121 # some statistics about the code base
127 # ensure all configs have MAINTAINERS entries
128 Check for configs without MAINTAINERS entry:
131 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
133 # Ensure host tools build
137 - make tools-only_config tools-only -j$(nproc)
139 # Ensure env tools build
143 - make tools-only_config envtools -j$(nproc)
145 Run binman, buildman, dtoc, Kconfig and patman testsuites:
148 - git config --global user.name "GitLab CI Runner";
149 git config --global user.email trini@konsulko.com;
151 virtualenv -p /usr/bin/python3 /tmp/venv;
152 . /tmp/venv/bin/activate;
153 pip install -r test/py/requirements.txt;
154 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
155 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
156 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
157 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
159 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
160 ./tools/buildman/buildman -t;
161 ./tools/dtoc/dtoc -t;
162 ./tools/patman/patman test;
165 Run tests for Nokia RX-51 (aka N900):
168 - ./tools/buildman/buildman --fetch-arch arm;
169 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
170 test/nokia_rx51_test.sh
172 # Test sandbox with test.py
175 TEST_PY_BD: "sandbox"
176 <<: *buildman_and_testpy_dfn
178 sandbox with clang test.py:
180 TEST_PY_BD: "sandbox"
181 OVERRIDE: "-O clang-10"
182 <<: *buildman_and_testpy_dfn
186 TEST_PY_BD: "sandbox_spl"
187 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
188 <<: *buildman_and_testpy_dfn
190 sandbox_noinst_test.py:
192 TEST_PY_BD: "sandbox_noinst"
193 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
194 <<: *buildman_and_testpy_dfn
198 TEST_PY_BD: "evb-ast2500"
199 TEST_PY_ID: "--id qemu"
200 <<: *buildman_and_testpy_dfn
202 sandbox_flattree test.py:
204 TEST_PY_BD: "sandbox_flattree"
205 <<: *buildman_and_testpy_dfn
207 integratorcp_cm926ejs test.py:
209 TEST_PY_BD: "integratorcp_cm926ejs"
210 TEST_PY_TEST_SPEC: "not sleep"
211 TEST_PY_ID: "--id qemu"
212 <<: *buildman_and_testpy_dfn
216 TEST_PY_BD: "qemu_arm"
217 TEST_PY_TEST_SPEC: "not sleep"
218 <<: *buildman_and_testpy_dfn
222 TEST_PY_BD: "qemu_arm64"
223 TEST_PY_TEST_SPEC: "not sleep"
224 <<: *buildman_and_testpy_dfn
229 TEST_PY_TEST_SPEC: "not sleep and not efi"
230 TEST_PY_ID: "--id qemu"
231 <<: *buildman_and_testpy_dfn
233 qemu_maltael test.py:
235 TEST_PY_BD: "maltael"
236 TEST_PY_TEST_SPEC: "not sleep and not efi"
237 TEST_PY_ID: "--id qemu"
238 <<: *buildman_and_testpy_dfn
240 qemu_malta64 test.py:
242 TEST_PY_BD: "malta64"
243 TEST_PY_TEST_SPEC: "not sleep and not efi"
244 TEST_PY_ID: "--id qemu"
245 <<: *buildman_and_testpy_dfn
247 qemu_malta64el test.py:
249 TEST_PY_BD: "malta64el"
250 TEST_PY_TEST_SPEC: "not sleep and not efi"
251 TEST_PY_ID: "--id qemu"
252 <<: *buildman_and_testpy_dfn
254 qemu-ppce500 test.py:
256 TEST_PY_BD: "qemu-ppce500"
257 TEST_PY_TEST_SPEC: "not sleep"
258 <<: *buildman_and_testpy_dfn
260 qemu-riscv32 test.py:
262 TEST_PY_BD: "qemu-riscv32"
263 TEST_PY_TEST_SPEC: "not sleep"
264 <<: *buildman_and_testpy_dfn
266 qemu-riscv64 test.py:
268 TEST_PY_BD: "qemu-riscv64"
269 TEST_PY_TEST_SPEC: "not sleep"
270 <<: *buildman_and_testpy_dfn
272 qemu-riscv32_spl test.py:
274 TEST_PY_BD: "qemu-riscv32_spl"
275 TEST_PY_TEST_SPEC: "not sleep"
276 <<: *buildman_and_testpy_dfn
278 qemu-riscv64_spl test.py:
280 TEST_PY_BD: "qemu-riscv64_spl"
281 TEST_PY_TEST_SPEC: "not sleep"
282 <<: *buildman_and_testpy_dfn
286 TEST_PY_BD: "qemu-x86"
287 TEST_PY_TEST_SPEC: "not sleep"
288 <<: *buildman_and_testpy_dfn
292 TEST_PY_BD: "qemu-x86_64"
293 TEST_PY_TEST_SPEC: "not sleep"
294 <<: *buildman_and_testpy_dfn
296 r2dplus_i82557c test.py:
298 TEST_PY_BD: "r2dplus"
299 TEST_PY_ID: "--id i82557c_qemu"
300 <<: *buildman_and_testpy_dfn
302 r2dplus_pcnet test.py:
304 TEST_PY_BD: "r2dplus"
305 TEST_PY_ID: "--id pcnet_qemu"
306 <<: *buildman_and_testpy_dfn
308 r2dplus_rtl8139 test.py:
310 TEST_PY_BD: "r2dplus"
311 TEST_PY_ID: "--id rtl8139_qemu"
312 <<: *buildman_and_testpy_dfn
314 r2dplus_tulip test.py:
316 TEST_PY_BD: "r2dplus"
317 TEST_PY_ID: "--id tulip_qemu"
318 <<: *buildman_and_testpy_dfn
320 xilinx_zynq_virt test.py:
322 TEST_PY_BD: "xilinx_zynq_virt"
323 TEST_PY_TEST_SPEC: "not sleep"
324 TEST_PY_ID: "--id qemu"
325 <<: *buildman_and_testpy_dfn
327 xilinx_versal_virt test.py:
329 TEST_PY_BD: "xilinx_versal_virt"
330 TEST_PY_TEST_SPEC: "not sleep"
331 TEST_PY_ID: "--id qemu"
332 <<: *buildman_and_testpy_dfn
337 TEST_PY_TEST_SPEC: "not sleep"
338 TEST_PY_ID: "--id qemu"
339 <<: *buildman_and_testpy_dfn