1 # SPDX-License-Identifier: GPL-2.0+
3 # Grab our configured image. The source for this is found at:
4 # https://gitlab.denx.de/u-boot/gitlab-ci-runner
5 image: trini/u-boot-gitlab-ci-runner:bionic-20200403-27Apr2020
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 git://github.com/swarren/uboot-test-hooks.git /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 - cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
24 - cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
25 - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
26 - cp /opt/grub/grubarm.efi ~/grub_arm.efi
27 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
28 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv32-bin.tar.xz | tar -C /tmp -xJ;
29 export OPENSBI=/tmp/opensbi-0.6-rv32-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
31 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
32 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv64-bin.tar.xz | tar -C /tmp -xJ;
33 export OPENSBI=/tmp/opensbi-0.6-rv64-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
37 - rm -rf /tmp/uboot-test-hooks /tmp/venv
39 # If we've been asked to use clang only do one configuration.
40 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
41 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
42 --board ${TEST_PY_BD} ${OVERRIDE}
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 --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:
58 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
59 if [[ $ret -ne 0 ]]; then
60 ./tools/buildman/buildman -o /tmp -seP;
64 build all 64bit ARM platforms:
68 - virtualenv -p /usr/bin/python3 /tmp/venv
69 - . /tmp/venv/bin/activate
70 - pip install pyelftools
72 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
73 if [[ $ret -ne 0 ]]; then
74 ./tools/buildman/buildman -o /tmp -seP;
78 build all PowerPC platforms:
83 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
84 if [[ $ret -ne 0 ]]; then
85 ./tools/buildman/buildman -o /tmp -seP;
89 build all other platforms:
94 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
95 if [[ $ret -ne 0 ]]; then
96 ./tools/buildman/buildman -o /tmp -seP;
100 # QA jobs for code analytics
101 # static code analysis with cppcheck (we can add --enable=all later)
106 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
108 # search for TODO within source tree
109 grep TODO/FIXME/HACK:
115 # search for HACK within source tree and ignore HACKKIT board
116 - grep -r HACK . | grep -v HACKKIT
118 # build HTML documentation
125 # some statistics about the code base
132 # ensure all configs have MAINTAINERS entries
133 Check for configs without MAINTAINERS entry:
137 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
139 # Ensure host tools build
144 - make tools-only_config tools-only -j$(nproc)
146 # Ensure env tools build
151 - make tools-only_config envtools -j$(nproc)
153 Run binman, buildman, dtoc, Kconfig and patman testsuites:
157 - git config --global user.name "GitLab CI Runner";
158 git config --global user.email trini@konsulko.com;
160 virtualenv -p /usr/bin/python3 /tmp/venv;
161 . /tmp/venv/bin/activate;
162 pip install pyelftools pytest;
163 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
164 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
165 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
166 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
167 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
168 ./tools/buildman/buildman -t;
169 ./tools/dtoc/dtoc -t;
170 ./tools/patman/patman --test;
173 Run tests for Nokia RX-51 (aka N900):
177 - ./tools/buildman/buildman --fetch-arch arm;
178 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
179 test/nokia_rx51_test.sh
181 # Test sandbox with test.py
185 TEST_PY_BD: "sandbox"
186 <<: *buildman_and_testpy_dfn
188 sandbox with clang test.py:
191 TEST_PY_BD: "sandbox"
192 OVERRIDE: "-O clang-10"
193 <<: *buildman_and_testpy_dfn
198 TEST_PY_BD: "sandbox_spl"
199 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
200 <<: *buildman_and_testpy_dfn
205 TEST_PY_BD: "evb-ast2500"
206 TEST_PY_ID: "--id qemu"
207 <<: *buildman_and_testpy_dfn
209 sandbox_flattree test.py:
212 TEST_PY_BD: "sandbox_flattree"
213 <<: *buildman_and_testpy_dfn
215 vexpress_ca15_tc2 test.py:
218 TEST_PY_BD: "vexpress_ca15_tc2"
219 TEST_PY_ID: "--id qemu"
220 <<: *buildman_and_testpy_dfn
222 vexpress_ca9x4 test.py:
225 TEST_PY_BD: "vexpress_ca9x4"
226 TEST_PY_ID: "--id qemu"
227 <<: *buildman_and_testpy_dfn
229 integratorcp_cm926ejs test.py:
232 TEST_PY_BD: "integratorcp_cm926ejs"
233 TEST_PY_TEST_SPEC: "not sleep"
234 TEST_PY_ID: "--id qemu"
235 <<: *buildman_and_testpy_dfn
240 TEST_PY_BD: "qemu_arm"
241 TEST_PY_TEST_SPEC: "not sleep"
242 <<: *buildman_and_testpy_dfn
247 TEST_PY_BD: "qemu_arm64"
248 TEST_PY_TEST_SPEC: "not sleep"
249 <<: *buildman_and_testpy_dfn
254 TEST_PY_BD: "qemu_mips"
255 TEST_PY_TEST_SPEC: "not sleep"
256 <<: *buildman_and_testpy_dfn
261 TEST_PY_BD: "qemu_mipsel"
262 TEST_PY_TEST_SPEC: "not sleep"
263 <<: *buildman_and_testpy_dfn
268 TEST_PY_BD: "qemu_mips64"
269 TEST_PY_TEST_SPEC: "not sleep"
270 <<: *buildman_and_testpy_dfn
272 qemu_mips64el test.py:
275 TEST_PY_BD: "qemu_mips64el"
276 TEST_PY_TEST_SPEC: "not sleep"
277 <<: *buildman_and_testpy_dfn
279 qemu-ppce500 test.py:
282 TEST_PY_BD: "qemu-ppce500"
283 TEST_PY_TEST_SPEC: "not sleep"
284 <<: *buildman_and_testpy_dfn
286 qemu-riscv32 test.py:
289 TEST_PY_BD: "qemu-riscv32"
290 TEST_PY_TEST_SPEC: "not sleep"
291 <<: *buildman_and_testpy_dfn
293 qemu-riscv64 test.py:
296 TEST_PY_BD: "qemu-riscv64"
297 TEST_PY_TEST_SPEC: "not sleep"
298 <<: *buildman_and_testpy_dfn
300 qemu-riscv32_spl test.py:
303 TEST_PY_BD: "qemu-riscv32_spl"
304 TEST_PY_TEST_SPEC: "not sleep"
305 <<: *buildman_and_testpy_dfn
307 qemu-riscv64_spl test.py:
310 TEST_PY_BD: "qemu-riscv64_spl"
311 TEST_PY_TEST_SPEC: "not sleep"
312 <<: *buildman_and_testpy_dfn
317 TEST_PY_BD: "qemu-x86"
318 TEST_PY_TEST_SPEC: "not sleep"
319 <<: *buildman_and_testpy_dfn
324 TEST_PY_BD: "qemu-x86_64"
325 TEST_PY_TEST_SPEC: "not sleep"
326 <<: *buildman_and_testpy_dfn
328 xilinx_zynq_virt test.py:
331 TEST_PY_BD: "xilinx_zynq_virt"
332 TEST_PY_TEST_SPEC: "not sleep"
333 TEST_PY_ID: "--id qemu"
334 <<: *buildman_and_testpy_dfn
336 xilinx_versal_virt test.py:
339 TEST_PY_BD: "xilinx_versal_virt"
340 TEST_PY_TEST_SPEC: "not sleep"
341 TEST_PY_ID: "--id qemu"
342 <<: *buildman_and_testpy_dfn
348 TEST_PY_TEST_SPEC: "not sleep"
349 TEST_PY_ID: "--id qemu"
350 <<: *buildman_and_testpy_dfn