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-20200112-21Feb2020
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/grubaa64.efi ~/grub_arm64.efi
25 - cp /opt/grub/grubarm.efi ~/grub_arm.efi
28 - rm -rf /tmp/uboot-test-hooks /tmp/venv
30 # From buildman, exit code 129 means warnings only. If we've been asked to
31 # use clang only do one configuration.
32 - if [[ "${BUILDMAN}" != "" ]]; then
34 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
35 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
36 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
40 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
41 # never prevent any test from running. That way, we can always pass
42 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
44 - virtualenv -p /usr/bin/python3 /tmp/venv
45 - . /tmp/venv/bin/activate
46 - pip install -r test/py/requirements.txt
47 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
48 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
49 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
50 if [[ "${TEST_PY_BD}" != "" ]]; then
51 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
52 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
53 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
55 if [[ $ret -ne 0 ]]; then
60 build all 32bit ARM platforms:
65 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
66 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
67 ./tools/buildman/buildman -o /tmp -sdeP;
71 build all 64bit ARM platforms:
75 - virtualenv -p /usr/bin/python3 /tmp/venv
76 - . /tmp/venv/bin/activate
77 - pip install pyelftools
79 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
80 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
81 ./tools/buildman/buildman -o /tmp -sdeP;
85 build all PowerPC platforms:
90 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
91 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
92 ./tools/buildman/buildman -o /tmp -sdeP;
96 build all other platforms:
101 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
102 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
103 ./tools/buildman/buildman -o /tmp -sdeP;
107 # QA jobs for code analytics
108 # static code analysis with cppcheck (we can add --enable=all later)
113 - cppcheck --force --quiet --inline-suppr .
115 # search for TODO within source tree
116 grep TODO/FIXME/HACK:
122 # search for HACK within source tree and ignore HACKKIT board
123 - grep -r HACK . | grep -v HACKKIT
125 # build HTML documentation
132 # some statistics about the code base
139 # ensure all configs have MAINTAINERS entries
140 Check for configs without MAINTAINERS entry:
144 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
146 # Ensure host tools build
151 - make tools-only_config tools-only -j$(nproc)
153 # Ensure env tools build
158 - make tools-only_config envtools -j$(nproc)
160 Run binman, buildman, dtoc, Kconfig and patman testsuites:
164 - git config --global user.name "GitLab CI Runner";
165 git config --global user.email trini@konsulko.com;
167 virtualenv -p /usr/bin/python3 /tmp/venv;
168 . /tmp/venv/bin/activate;
169 pip install pyelftools pytest;
170 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
171 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
172 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
173 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
174 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
175 ./tools/buildman/buildman -t;
176 ./tools/dtoc/dtoc -t;
177 ./tools/patman/patman --test;
180 # Test sandbox with test.py
184 TEST_PY_BD: "sandbox"
185 BUILDMAN: "^sandbox$"
186 <<: *buildman_and_testpy_dfn
188 sandbox with clang test.py:
191 TEST_PY_BD: "sandbox"
192 BUILDMAN: "^sandbox$"
193 OVERRIDE: "-O clang-7"
194 <<: *buildman_and_testpy_dfn
199 TEST_PY_BD: "sandbox_spl"
200 BUILDMAN: "^sandbox_spl$"
201 TEST_PY_TEST_SPEC: "test_ofplatdata"
202 <<: *buildman_and_testpy_dfn
207 TEST_PY_BD: "evb-ast2500"
208 TEST_PY_ID: "--id qemu"
209 BUILDMAN: "^evb-ast2500$"
210 <<: *buildman_and_testpy_dfn
212 sandbox_flattree test.py:
215 TEST_PY_BD: "sandbox_flattree"
216 BUILDMAN: "^sandbox_flattree$"
217 <<: *buildman_and_testpy_dfn
219 vexpress_ca15_tc2 test.py:
222 TEST_PY_BD: "vexpress_ca15_tc2"
223 TEST_PY_ID: "--id qemu"
224 BUILDMAN: "^vexpress_ca15_tc2$"
225 <<: *buildman_and_testpy_dfn
227 vexpress_ca9x4 test.py:
230 TEST_PY_BD: "vexpress_ca9x4"
231 TEST_PY_ID: "--id qemu"
232 BUILDMAN: "^vexpress_ca9x4$"
233 <<: *buildman_and_testpy_dfn
235 integratorcp_cm926ejs test.py:
238 TEST_PY_BD: "integratorcp_cm926ejs"
239 TEST_PY_TEST_SPEC: "not sleep"
240 TEST_PY_ID: "--id qemu"
241 BUILDMAN: "^integratorcp_cm926ejs$"
242 <<: *buildman_and_testpy_dfn
247 TEST_PY_BD: "qemu_arm"
248 TEST_PY_TEST_SPEC: "not sleep"
249 BUILDMAN: "^qemu_arm$"
250 <<: *buildman_and_testpy_dfn
255 TEST_PY_BD: "qemu_arm64"
256 TEST_PY_TEST_SPEC: "not sleep"
257 BUILDMAN: "^qemu_arm64$"
258 <<: *buildman_and_testpy_dfn
263 TEST_PY_BD: "qemu_mips"
264 TEST_PY_TEST_SPEC: "not sleep"
265 BUILDMAN: "^qemu_mips$"
266 <<: *buildman_and_testpy_dfn
271 TEST_PY_BD: "qemu_mipsel"
272 TEST_PY_TEST_SPEC: "not sleep"
273 BUILDMAN: "^qemu_mipsel$"
274 <<: *buildman_and_testpy_dfn
279 TEST_PY_BD: "qemu_mips64"
280 TEST_PY_TEST_SPEC: "not sleep"
281 BUILDMAN: "^qemu_mips64$"
282 <<: *buildman_and_testpy_dfn
284 qemu_mips64el test.py:
287 TEST_PY_BD: "qemu_mips64el"
288 TEST_PY_TEST_SPEC: "not sleep"
289 BUILDMAN: "^qemu_mips64el$"
290 <<: *buildman_and_testpy_dfn
292 qemu-ppce500 test.py:
295 TEST_PY_BD: "qemu-ppce500"
296 TEST_PY_TEST_SPEC: "not sleep"
297 BUILDMAN: "^qemu-ppce500$"
298 <<: *buildman_and_testpy_dfn
300 qemu-riscv64 test.py:
303 TEST_PY_BD: "qemu-riscv64"
304 TEST_PY_TEST_SPEC: "not sleep"
305 BUILDMAN: "^qemu-riscv64$"
306 <<: *buildman_and_testpy_dfn
311 TEST_PY_BD: "qemu-x86"
312 TEST_PY_TEST_SPEC: "not sleep"
313 BUILDMAN: "^qemu-x86$"
314 <<: *buildman_and_testpy_dfn
319 TEST_PY_BD: "qemu-x86_64"
320 TEST_PY_TEST_SPEC: "not sleep"
321 BUILDMAN: "^qemu-x86_64$"
322 <<: *buildman_and_testpy_dfn
324 xilinx_zynq_virt test.py:
327 TEST_PY_BD: "xilinx_zynq_virt"
328 TEST_PY_TEST_SPEC: "not sleep"
329 TEST_PY_ID: "--id qemu"
330 BUILDMAN: "^xilinx_zynq_virt$"
331 <<: *buildman_and_testpy_dfn
333 xilinx_versal_virt test.py:
336 TEST_PY_BD: "xilinx_versal_virt"
337 TEST_PY_TEST_SPEC: "not sleep"
338 TEST_PY_ID: "--id qemu"
339 BUILDMAN: "^xilinx_versal_virt$"
340 <<: *buildman_and_testpy_dfn
346 TEST_PY_TEST_SPEC: "not sleep"
347 TEST_PY_ID: "--id qemu"
349 <<: *buildman_and_testpy_dfn