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:bionic-20200807-02Sep2020
7 # We run some tests in different order, to catch some failures quicker.
13 .buildman_and_testpy_template: &buildman_and_testpy_dfn
17 # Clone uboot-test-hooks
18 - git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
19 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
20 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
21 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
22 - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
23 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
24 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
25 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
27 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
28 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
29 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
33 - rm -rf /tmp/uboot-test-hooks /tmp/venv
35 # If we've been asked to use clang only do one configuration.
36 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
37 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
38 --board ${TEST_PY_BD} ${OVERRIDE}
39 - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
40 - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
41 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
42 - cp /opt/grub/grubriscv32.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv32.efi
43 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
44 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
45 - virtualenv -p /usr/bin/python3 /tmp/venv
46 - . /tmp/venv/bin/activate
47 - pip install -r test/py/requirements.txt
48 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
49 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
50 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
51 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
52 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
53 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
55 build all 32bit ARM platforms:
60 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
61 if [[ $ret -ne 0 ]]; then
62 ./tools/buildman/buildman -o /tmp -seP;
66 build all 64bit ARM platforms:
70 - virtualenv -p /usr/bin/python3 /tmp/venv
71 - . /tmp/venv/bin/activate
72 - pip install pyelftools
74 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
75 if [[ $ret -ne 0 ]]; then
76 ./tools/buildman/buildman -o /tmp -seP;
80 build all PowerPC platforms:
85 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
86 if [[ $ret -ne 0 ]]; then
87 ./tools/buildman/buildman -o /tmp -seP;
91 build all other platforms:
96 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
97 if [[ $ret -ne 0 ]]; then
98 ./tools/buildman/buildman -o /tmp -seP;
102 # QA jobs for code analytics
103 # static code analysis with cppcheck (we can add --enable=all later)
108 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
110 # search for TODO within source tree
111 grep TODO/FIXME/HACK:
117 # search for HACK within source tree and ignore HACKKIT board
118 - grep -r HACK . | grep -v HACKKIT
120 # build HTML documentation
125 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
126 - . /tmp/venvhtml/bin/activate
127 - pip install -r doc/sphinx/requirements.txt
130 # some statistics about the code base
137 # ensure all configs have MAINTAINERS entries
138 Check for configs without MAINTAINERS entry:
142 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
144 # Ensure host tools build
149 - make tools-only_config tools-only -j$(nproc)
151 # Ensure env tools build
156 - make tools-only_config envtools -j$(nproc)
158 Run binman, buildman, dtoc, Kconfig and patman testsuites:
162 - git config --global user.name "GitLab CI Runner";
165 virtualenv -p /usr/bin/python3 /tmp/venv;
166 . /tmp/venv/bin/activate;
167 pip install pyelftools pytest pygit2;
168 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
169 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
170 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
171 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
173 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
174 ./tools/buildman/buildman -t;
175 ./tools/dtoc/dtoc -t;
176 ./tools/patman/patman test;
179 Run tests for Nokia RX-51 (aka N900):
183 - ./tools/buildman/buildman --fetch-arch arm;
184 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
185 test/nokia_rx51_test.sh
187 # Test sandbox with test.py
191 TEST_PY_BD: "sandbox"
192 <<: *buildman_and_testpy_dfn
194 sandbox with clang test.py:
197 TEST_PY_BD: "sandbox"
198 OVERRIDE: "-O clang-10"
199 <<: *buildman_and_testpy_dfn
204 TEST_PY_BD: "sandbox_spl"
205 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
206 <<: *buildman_and_testpy_dfn
208 sandbox_noinst_test.py:
211 TEST_PY_BD: "sandbox_noinst"
212 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
213 <<: *buildman_and_testpy_dfn
218 TEST_PY_BD: "evb-ast2500"
219 TEST_PY_ID: "--id qemu"
220 <<: *buildman_and_testpy_dfn
222 sandbox_flattree test.py:
225 TEST_PY_BD: "sandbox_flattree"
226 <<: *buildman_and_testpy_dfn
228 vexpress_ca15_tc2 test.py:
231 TEST_PY_BD: "vexpress_ca15_tc2"
232 TEST_PY_ID: "--id qemu"
233 <<: *buildman_and_testpy_dfn
235 vexpress_ca9x4 test.py:
238 TEST_PY_BD: "vexpress_ca9x4"
239 TEST_PY_ID: "--id qemu"
240 <<: *buildman_and_testpy_dfn
242 integratorcp_cm926ejs test.py:
245 TEST_PY_BD: "integratorcp_cm926ejs"
246 TEST_PY_TEST_SPEC: "not sleep"
247 TEST_PY_ID: "--id qemu"
248 <<: *buildman_and_testpy_dfn
253 TEST_PY_BD: "qemu_arm"
254 TEST_PY_TEST_SPEC: "not sleep"
255 <<: *buildman_and_testpy_dfn
260 TEST_PY_BD: "qemu_arm64"
261 TEST_PY_TEST_SPEC: "not sleep"
262 <<: *buildman_and_testpy_dfn
267 TEST_PY_BD: "qemu_mips"
268 TEST_PY_TEST_SPEC: "not sleep"
269 <<: *buildman_and_testpy_dfn
274 TEST_PY_BD: "qemu_mipsel"
275 TEST_PY_TEST_SPEC: "not sleep"
276 <<: *buildman_and_testpy_dfn
281 TEST_PY_BD: "qemu_mips64"
282 TEST_PY_TEST_SPEC: "not sleep"
283 <<: *buildman_and_testpy_dfn
285 qemu_mips64el test.py:
288 TEST_PY_BD: "qemu_mips64el"
289 TEST_PY_TEST_SPEC: "not sleep"
290 <<: *buildman_and_testpy_dfn
296 TEST_PY_TEST_SPEC: "not sleep and not efi"
297 TEST_PY_ID: "--id qemu"
298 <<: *buildman_and_testpy_dfn
300 qemu_maltael test.py:
303 TEST_PY_BD: "maltael"
304 TEST_PY_TEST_SPEC: "not sleep and not efi"
305 TEST_PY_ID: "--id qemu"
306 <<: *buildman_and_testpy_dfn
308 qemu_malta64 test.py:
311 TEST_PY_BD: "malta64"
312 TEST_PY_TEST_SPEC: "not sleep and not efi"
313 TEST_PY_ID: "--id qemu"
314 <<: *buildman_and_testpy_dfn
316 qemu_malta64el test.py:
319 TEST_PY_BD: "malta64el"
320 TEST_PY_TEST_SPEC: "not sleep and not efi"
321 TEST_PY_ID: "--id qemu"
322 <<: *buildman_and_testpy_dfn
324 qemu-ppce500 test.py:
327 TEST_PY_BD: "qemu-ppce500"
328 TEST_PY_TEST_SPEC: "not sleep"
329 <<: *buildman_and_testpy_dfn
331 qemu-riscv32 test.py:
334 TEST_PY_BD: "qemu-riscv32"
335 TEST_PY_TEST_SPEC: "not sleep"
336 <<: *buildman_and_testpy_dfn
338 qemu-riscv64 test.py:
341 TEST_PY_BD: "qemu-riscv64"
342 TEST_PY_TEST_SPEC: "not sleep"
343 <<: *buildman_and_testpy_dfn
345 qemu-riscv32_spl test.py:
348 TEST_PY_BD: "qemu-riscv32_spl"
349 TEST_PY_TEST_SPEC: "not sleep"
350 <<: *buildman_and_testpy_dfn
352 qemu-riscv64_spl test.py:
355 TEST_PY_BD: "qemu-riscv64_spl"
356 TEST_PY_TEST_SPEC: "not sleep"
357 <<: *buildman_and_testpy_dfn
362 TEST_PY_BD: "qemu-x86"
363 TEST_PY_TEST_SPEC: "not sleep"
364 <<: *buildman_and_testpy_dfn
369 TEST_PY_BD: "qemu-x86_64"
370 TEST_PY_TEST_SPEC: "not sleep"
371 <<: *buildman_and_testpy_dfn
373 r2dplus_i82557c test.py:
376 TEST_PY_BD: "r2dplus"
377 TEST_PY_ID: "--id i82557c_qemu"
378 <<: *buildman_and_testpy_dfn
380 r2dplus_pcnet test.py:
383 TEST_PY_BD: "r2dplus"
384 TEST_PY_ID: "--id pcnet_qemu"
385 <<: *buildman_and_testpy_dfn
387 r2dplus_rtl8139 test.py:
390 TEST_PY_BD: "r2dplus"
391 TEST_PY_ID: "--id rtl8139_qemu"
392 <<: *buildman_and_testpy_dfn
394 r2dplus_tulip test.py:
397 TEST_PY_BD: "r2dplus"
398 TEST_PY_ID: "--id tulip_qemu"
399 <<: *buildman_and_testpy_dfn
401 xilinx_zynq_virt test.py:
404 TEST_PY_BD: "xilinx_zynq_virt"
405 TEST_PY_TEST_SPEC: "not sleep"
406 TEST_PY_ID: "--id qemu"
407 <<: *buildman_and_testpy_dfn
409 xilinx_versal_virt test.py:
412 TEST_PY_BD: "xilinx_versal_virt"
413 TEST_PY_TEST_SPEC: "not sleep"
414 TEST_PY_ID: "--id qemu"
415 <<: *buildman_and_testpy_dfn
421 TEST_PY_TEST_SPEC: "not sleep"
422 TEST_PY_ID: "--id qemu"
423 <<: *buildman_and_testpy_dfn