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-20191010-20Oct2019
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
24 - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di )
26 - ( cd ~/grub2-arm64; wget -O - http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm | rpm2cpio | cpio -di )
29 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
31 # From buildman, exit code 129 means warnings only. If we've been asked to
32 # use clang only do one configuration.
33 - if [[ "${BUILDMAN}" != "" ]]; then
35 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
36 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
37 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
41 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
42 # never prevent any test from running. That way, we can always pass
43 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
45 - virtualenv -p /usr/bin/python3 /tmp/venv
46 - . /tmp/venv/bin/activate
47 - pip install -r test/py/requirements.txt
48 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
49 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
50 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
51 if [[ "${TEST_PY_BD}" != "" ]]; then
52 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
53 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
54 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
56 if [[ $ret -ne 0 ]]; then
61 build all 32bit ARM platforms:
66 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
67 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
68 ./tools/buildman/buildman -o /tmp -sdeP;
72 build all 64bit ARM platforms:
76 - virtualenv /tmp/venv
77 - . /tmp/venv/bin/activate
78 - pip install pyelftools
80 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
81 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
82 ./tools/buildman/buildman -o /tmp -sdeP;
86 build all PowerPC platforms:
91 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
92 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
93 ./tools/buildman/buildman -o /tmp -sdeP;
97 build all other platforms:
102 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
103 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
104 ./tools/buildman/buildman -o /tmp -sdeP;
108 # QA jobs for code analytics
109 # static code analysis with cppcheck (we can add --enable=all later)
114 - cppcheck --force --quiet --inline-suppr .
116 # search for TODO within source tree
117 grep TODO/FIXME/HACK:
123 # search for HACK within source tree and ignore HACKKIT board
124 - grep -r HACK . | grep -v HACKKIT
126 # some statistics about the code base
133 # ensure all configs have MAINTAINERS entries
134 Check for configs without MAINTAINERS entry:
138 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
140 # Ensure host tools build
145 - make tools-only_config tools-only -j$(nproc)
147 # Ensure env tools build
152 - make tools-only_config envtools -j$(nproc)
154 Run binman, buildman, dtoc and patman testsuites:
158 - git config --global user.name "GitLab CI Runner";
159 git config --global user.email trini@konsulko.com;
161 virtualenv /tmp/venv;
162 . /tmp/venv/bin/activate;
163 pip install pyelftools;
164 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
165 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
166 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
167 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
168 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
169 ./tools/buildman/buildman -t;
170 ./tools/dtoc/dtoc -t;
171 ./tools/patman/patman --test
173 # Test sandbox with test.py
177 TEST_PY_BD: "sandbox"
178 BUILDMAN: "^sandbox$"
179 <<: *buildman_and_testpy_dfn
181 sandbox with clang test.py:
184 TEST_PY_BD: "sandbox"
185 BUILDMAN: "^sandbox$"
186 OVERRIDE: "-O clang-7"
187 <<: *buildman_and_testpy_dfn
192 TEST_PY_BD: "sandbox_spl"
193 BUILDMAN: "^sandbox_spl$"
194 TEST_PY_TEST_SPEC: "test_ofplatdata"
195 <<: *buildman_and_testpy_dfn
200 TEST_PY_BD: "evb-ast2500"
201 TEST_PY_ID: "--id qemu"
202 BUILDMAN: "^evb-ast2500$"
203 <<: *buildman_and_testpy_dfn
205 sandbox_flattree test.py:
208 TEST_PY_BD: "sandbox_flattree"
209 BUILDMAN: "^sandbox_flattree$"
210 <<: *buildman_and_testpy_dfn
212 vexpress_ca15_tc2 test.py:
215 TEST_PY_BD: "vexpress_ca15_tc2"
216 TEST_PY_ID: "--id qemu"
217 BUILDMAN: "^vexpress_ca15_tc2$"
218 <<: *buildman_and_testpy_dfn
220 vexpress_ca9x4 test.py:
223 TEST_PY_BD: "vexpress_ca9x4"
224 TEST_PY_ID: "--id qemu"
225 BUILDMAN: "^vexpress_ca9x4$"
226 <<: *buildman_and_testpy_dfn
228 integratorcp_cm926ejs test.py:
231 TEST_PY_BD: "integratorcp_cm926ejs"
232 TEST_PY_TEST_SPEC: "not sleep"
233 TEST_PY_ID: "--id qemu"
234 BUILDMAN: "^integratorcp_cm926ejs$"
235 <<: *buildman_and_testpy_dfn
240 TEST_PY_BD: "qemu_arm"
241 TEST_PY_TEST_SPEC: "not sleep"
242 BUILDMAN: "^qemu_arm$"
243 <<: *buildman_and_testpy_dfn
248 TEST_PY_BD: "qemu_arm64"
249 TEST_PY_TEST_SPEC: "not sleep"
250 BUILDMAN: "^qemu_arm64$"
251 <<: *buildman_and_testpy_dfn
256 TEST_PY_BD: "qemu_mips"
257 TEST_PY_TEST_SPEC: "not sleep"
258 BUILDMAN: "^qemu_mips$"
259 <<: *buildman_and_testpy_dfn
264 TEST_PY_BD: "qemu_mipsel"
265 TEST_PY_TEST_SPEC: "not sleep"
266 BUILDMAN: "^qemu_mipsel$"
267 <<: *buildman_and_testpy_dfn
272 TEST_PY_BD: "qemu_mips64"
273 TEST_PY_TEST_SPEC: "not sleep"
274 BUILDMAN: "^qemu_mips64$"
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: "^qemu_mips64el$"
283 <<: *buildman_and_testpy_dfn
285 qemu-ppce500 test.py:
288 TEST_PY_BD: "qemu-ppce500"
289 TEST_PY_TEST_SPEC: "not sleep"
290 BUILDMAN: "^qemu-ppce500$"
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: "^qemu-riscv64$"
299 <<: *buildman_and_testpy_dfn
304 TEST_PY_BD: "qemu-x86"
305 TEST_PY_TEST_SPEC: "not sleep"
306 BUILDMAN: "^qemu-x86$"
307 <<: *buildman_and_testpy_dfn
312 TEST_PY_BD: "qemu-x86_64"
313 TEST_PY_TEST_SPEC: "not sleep"
314 BUILDMAN: "^qemu-x86_64$"
315 <<: *buildman_and_testpy_dfn
320 TEST_PY_BD: "zynq_zc702"
321 TEST_PY_TEST_SPEC: "not sleep"
322 TEST_PY_ID: "--id qemu"
323 BUILDMAN: "^zynq_zc702$"
324 <<: *buildman_and_testpy_dfn
326 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: "^xilinx_versal_virt$"
333 <<: *buildman_and_testpy_dfn
339 TEST_PY_TEST_SPEC: "not sleep"
340 TEST_PY_ID: "--id qemu"
342 <<: *buildman_and_testpy_dfn