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-20200311-10Apr2020
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 # From buildman, exit code 129 means warnings only. If we've been asked to
40 # use clang only do one configuration.
42 tools/buildman/buildman -o /tmp -P -E --board ${TEST_PY_BD} ${OVERRIDE}
44 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
45 tools/buildman/buildman -o /tmp -seP --board ${TEST_PY_BD};
48 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
49 # never prevent any test from running. That way, we can always pass
50 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
52 - virtualenv -p /usr/bin/python3 /tmp/venv
53 - . /tmp/venv/bin/activate
54 - pip install -r test/py/requirements.txt
55 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
56 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
57 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
58 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
59 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
60 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
62 if [[ $ret -ne 0 ]]; then
66 build all 32bit ARM platforms:
71 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
72 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
73 ./tools/buildman/buildman -o /tmp -seP;
77 build all 64bit ARM platforms:
81 - virtualenv -p /usr/bin/python3 /tmp/venv
82 - . /tmp/venv/bin/activate
83 - pip install pyelftools
85 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
86 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
87 ./tools/buildman/buildman -o /tmp -seP;
91 build all PowerPC platforms:
96 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
97 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
98 ./tools/buildman/buildman -o /tmp -seP;
102 build all other platforms:
107 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
108 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
109 ./tools/buildman/buildman -o /tmp -seP;
113 # QA jobs for code analytics
114 # static code analysis with cppcheck (we can add --enable=all later)
119 - cppcheck --force --quiet --inline-suppr .
121 # search for TODO within source tree
122 grep TODO/FIXME/HACK:
128 # search for HACK within source tree and ignore HACKKIT board
129 - grep -r HACK . | grep -v HACKKIT
131 # build HTML documentation
138 # some statistics about the code base
145 # ensure all configs have MAINTAINERS entries
146 Check for configs without MAINTAINERS entry:
150 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
152 # Ensure host tools build
157 - make tools-only_config tools-only -j$(nproc)
159 # Ensure env tools build
164 - make tools-only_config envtools -j$(nproc)
166 Run binman, buildman, dtoc, Kconfig and patman testsuites:
170 - git config --global user.name "GitLab CI Runner";
171 git config --global user.email trini@konsulko.com;
173 virtualenv -p /usr/bin/python3 /tmp/venv;
174 . /tmp/venv/bin/activate;
175 pip install pyelftools pytest;
176 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
177 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
178 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
179 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
180 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
181 ./tools/buildman/buildman -t;
182 ./tools/dtoc/dtoc -t;
183 ./tools/patman/patman --test;
186 # Test sandbox with test.py
190 TEST_PY_BD: "sandbox"
191 <<: *buildman_and_testpy_dfn
193 sandbox with clang test.py:
196 TEST_PY_BD: "sandbox"
197 OVERRIDE: "-O clang-7"
198 <<: *buildman_and_testpy_dfn
203 TEST_PY_BD: "sandbox_spl"
204 TEST_PY_TEST_SPEC: "test_ofplatdata"
205 <<: *buildman_and_testpy_dfn
210 TEST_PY_BD: "evb-ast2500"
211 TEST_PY_ID: "--id qemu"
212 <<: *buildman_and_testpy_dfn
214 sandbox_flattree test.py:
217 TEST_PY_BD: "sandbox_flattree"
218 <<: *buildman_and_testpy_dfn
220 vexpress_ca15_tc2 test.py:
223 TEST_PY_BD: "vexpress_ca15_tc2"
224 TEST_PY_ID: "--id qemu"
225 <<: *buildman_and_testpy_dfn
227 vexpress_ca9x4 test.py:
230 TEST_PY_BD: "vexpress_ca9x4"
231 TEST_PY_ID: "--id qemu"
232 <<: *buildman_and_testpy_dfn
234 integratorcp_cm926ejs test.py:
237 TEST_PY_BD: "integratorcp_cm926ejs"
238 TEST_PY_TEST_SPEC: "not sleep"
239 TEST_PY_ID: "--id qemu"
240 <<: *buildman_and_testpy_dfn
245 TEST_PY_BD: "qemu_arm"
246 TEST_PY_TEST_SPEC: "not sleep"
247 <<: *buildman_and_testpy_dfn
252 TEST_PY_BD: "qemu_arm64"
253 TEST_PY_TEST_SPEC: "not sleep"
254 <<: *buildman_and_testpy_dfn
259 TEST_PY_BD: "qemu_mips"
260 TEST_PY_TEST_SPEC: "not sleep"
261 <<: *buildman_and_testpy_dfn
266 TEST_PY_BD: "qemu_mipsel"
267 TEST_PY_TEST_SPEC: "not sleep"
268 <<: *buildman_and_testpy_dfn
273 TEST_PY_BD: "qemu_mips64"
274 TEST_PY_TEST_SPEC: "not sleep"
275 <<: *buildman_and_testpy_dfn
277 qemu_mips64el test.py:
280 TEST_PY_BD: "qemu_mips64el"
281 TEST_PY_TEST_SPEC: "not sleep"
282 <<: *buildman_and_testpy_dfn
284 qemu-ppce500 test.py:
287 TEST_PY_BD: "qemu-ppce500"
288 TEST_PY_TEST_SPEC: "not sleep"
289 <<: *buildman_and_testpy_dfn
291 qemu-riscv32 test.py:
294 TEST_PY_BD: "qemu-riscv32"
295 TEST_PY_TEST_SPEC: "not sleep"
296 <<: *buildman_and_testpy_dfn
298 qemu-riscv64 test.py:
301 TEST_PY_BD: "qemu-riscv64"
302 TEST_PY_TEST_SPEC: "not sleep"
303 <<: *buildman_and_testpy_dfn
305 qemu-riscv32_spl test.py:
308 TEST_PY_BD: "qemu-riscv32_spl"
309 TEST_PY_TEST_SPEC: "not sleep"
310 <<: *buildman_and_testpy_dfn
312 qemu-riscv64_spl test.py:
315 TEST_PY_BD: "qemu-riscv64_spl"
316 TEST_PY_TEST_SPEC: "not sleep"
317 <<: *buildman_and_testpy_dfn
322 TEST_PY_BD: "qemu-x86"
323 TEST_PY_TEST_SPEC: "not sleep"
324 <<: *buildman_and_testpy_dfn
329 TEST_PY_BD: "qemu-x86_64"
330 TEST_PY_TEST_SPEC: "not sleep"
331 <<: *buildman_and_testpy_dfn
333 xilinx_zynq_virt test.py:
336 TEST_PY_BD: "xilinx_zynq_virt"
337 TEST_PY_TEST_SPEC: "not sleep"
338 TEST_PY_ID: "--id qemu"
339 <<: *buildman_and_testpy_dfn
341 xilinx_versal_virt test.py:
344 TEST_PY_BD: "xilinx_versal_virt"
345 TEST_PY_TEST_SPEC: "not sleep"
346 TEST_PY_ID: "--id qemu"
347 <<: *buildman_and_testpy_dfn
353 TEST_PY_TEST_SPEC: "not sleep"
354 TEST_PY_ID: "--id qemu"
355 <<: *buildman_and_testpy_dfn