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:xenial-20190222-24April2019
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 - virtualenv /tmp/venv
22 - . /tmp/venv/bin/activate
23 - pip install pytest==2.8.7
24 - pip install python-subunit
25 - pip install pyelftools
26 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
27 - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
29 - ( 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 )
31 - ( 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 )
32 - if [[ "${QEMU_TARGET}" != "" ]]; then
33 git clone git://git.qemu.org/qemu.git /tmp/qemu;
35 git submodule update --init dtc &&
36 git checkout ${QEMU_VERSION} &&
37 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
38 make -j$(nproc) all install;
42 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/qemu /tmp/venv
44 # From buildman, exit code 129 means warnings only. If we've been asked to
45 # use clang only do one configuration.
46 - if [[ "${BUILDMAN}" != "" ]]; then
48 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
49 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
50 tools/buildman/buildman -sdeP ${BUILDMAN};
54 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
55 # never prevent any test from running. That way, we can always pass
56 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
58 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
59 export PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
60 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
61 if [[ "${TEST_PY_BD}" != "" ]]; then
62 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
63 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
64 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
66 if [[ $ret -ne 0 ]]; then
76 ./tools/buildman/buildman -P -E || ret=$?;
77 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
78 ./tools/buildman/buildman -sdeP;
82 # QA jobs for code analytics
83 # static code analysis with cppcheck (we can add --enable=all later)
88 - cppcheck --force --quiet --inline-suppr .
90 # search for TODO within source tree
97 # search for HACK within source tree and ignore HACKKIT board
98 - grep -r HACK . | grep -v HACKKIT
100 # some statistics about the code base
107 # ensure all configs have MAINTAINERS entries
108 Check for configs without MAINTAINERS entry:
112 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
114 # Ensure host tools build
119 - make tools-only_config tools-only -j$(nproc)
121 # Run various tool tests
122 Run patman testsuite:
126 - git config --global user.name "GitLab CI Runner"
127 - git config --global user.email trini@konsulko.com
128 - ./tools/patman/patman --test
130 Run buildman testsuite:
134 - ./tools/buildman/buildman -t
136 Run binman and dtoc testsuite:
140 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl;
141 ./tools/buildman/buildman -P sandbox_spl &&
142 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
143 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
144 ./tools/binman/binman -t &&
147 # Test sandbox with test.py
151 TEST_PY_BD: "sandbox"
152 BUILDMAN: "^sandbox$"
153 <<: *buildman_and_testpy_dfn
158 TEST_PY_BD: "sandbox_spl"
159 BUILDMAN: "^sandbox_spl$"
160 TEST_PY_TEST_SPEC: "test_ofplatdata"
161 <<: *buildman_and_testpy_dfn
166 TEST_PY_BD: "evb-ast2500"
167 TEST_PY_ID: "--id qemu"
168 QEMU_TARGET: "arm-softmmu"
169 QEMU_VERSION: "506179e42112be77bfd071f050b15762d3b2cd43"
170 BUILDMAN: "^evb-ast2500$"
171 <<: *buildman_and_testpy_dfn
173 sandbox_flattree test.py:
176 TEST_PY_BD: "sandbox_flattree"
177 BUILDMAN: "^sandbox_flattree$"
178 <<: *buildman_and_testpy_dfn
180 vexpress_ca15_tc2 test.py:
183 TEST_PY_BD: "vexpress_ca15_tc2"
184 TEST_PY_ID: "--id qemu"
185 QEMU_TARGET: "arm-softmmu"
186 QEMU_VERSION: "v3.0.0"
187 BUILDMAN: "^vexpress_ca15_tc2$"
188 <<: *buildman_and_testpy_dfn
190 vexpress_ca9x4 test.py:
193 TEST_PY_BD: "vexpress_ca9x4"
194 TEST_PY_ID: "--id qemu"
195 QEMU_TARGET: "arm-softmmu"
196 BUILDMAN: "^vexpress_ca9x4$"
197 <<: *buildman_and_testpy_dfn
199 integratorcp_cm926ejs test.py:
202 TEST_PY_BD: "integratorcp_cm926ejs"
203 TEST_PY_TEST_SPEC: "not sleep"
204 TEST_PY_ID: "--id qemu"
205 QEMU_TARGET: "arm-softmmu"
206 BUILDMAN: "^integratorcp_cm926ejs$"
207 <<: *buildman_and_testpy_dfn
212 TEST_PY_BD: "qemu_arm"
213 TEST_PY_TEST_SPEC: "not sleep"
214 QEMU_TARGET: "arm-softmmu"
215 BUILDMAN: "^qemu_arm$"
216 <<: *buildman_and_testpy_dfn
221 TEST_PY_BD: "qemu_arm64"
222 TEST_PY_TEST_SPEC: "not sleep"
223 QEMU_TARGET: "aarch64-softmmu"
224 BUILDMAN: "^qemu_arm64$"
225 <<: *buildman_and_testpy_dfn
230 TEST_PY_BD: "qemu_mips"
231 TEST_PY_TEST_SPEC: "not sleep"
232 QEMU_TARGET: "mips-softmmu"
233 BUILDMAN: "^qemu_mips$"
235 <<: *buildman_and_testpy_dfn
240 TEST_PY_BD: "qemu_mipsel"
241 TEST_PY_TEST_SPEC: "not sleep"
242 QEMU_TARGET: "mipsel-softmmu"
243 BUILDMAN: "^qemu_mipsel$"
245 <<: *buildman_and_testpy_dfn
250 TEST_PY_BD: "qemu_mips64"
251 TEST_PY_TEST_SPEC: "not sleep"
252 QEMU_TARGET: "mips64-softmmu"
253 BUILDMAN: "^qemu_mips64$"
255 <<: *buildman_and_testpy_dfn
257 qemu_mips64el test.py:
260 TEST_PY_BD: "qemu_mips64el"
261 TEST_PY_TEST_SPEC: "not sleep"
262 QEMU_TARGET: "mips64el-softmmu"
263 BUILDMAN: "^qemu_mips64el$"
265 <<: *buildman_and_testpy_dfn
267 qemu-ppce500 test.py:
270 TEST_PY_BD: "qemu-ppce500"
271 TEST_PY_TEST_SPEC: "not sleep"
272 QEMU_TARGET: "ppc-softmmu"
273 BUILDMAN: "^qemu-ppce500$"
275 <<: *buildman_and_testpy_dfn
280 TEST_PY_BD: "qemu-x86"
281 TEST_PY_TEST_SPEC: "not sleep"
282 QEMU_TARGET: "i386-softmmu"
283 BUILDMAN: "^qemu-x86$"
285 <<: *buildman_and_testpy_dfn
290 TEST_PY_BD: "qemu-x86_64"
291 TEST_PY_TEST_SPEC: "not sleep"
292 QEMU_TARGET: "x86_64-softmmu"
293 BUILDMAN: "^qemu-x86_64$"
295 <<: *buildman_and_testpy_dfn
300 TEST_PY_BD: "zynq_zc702"
301 TEST_PY_TEST_SPEC: "not sleep"
302 QEMU_TARGET: "arm-softmmu"
303 TEST_PY_ID: "--id qemu"
304 BUILDMAN: "^zynq_zc702$"
305 <<: *buildman_and_testpy_dfn
307 xilinx_versal_virt test.py:
310 TEST_PY_BD: "xilinx_versal_virt"
311 TEST_PY_TEST_SPEC: "not sleep"
312 QEMU_TARGET: "aarch64-softmmu"
313 TEST_PY_ID: "--id qemu"
314 BUILDMAN: "^xilinx_versal_virt$"
315 <<: *buildman_and_testpy_dfn
321 TEST_PY_TEST_SPEC: "not sleep"
322 QEMU_TARGET: "xtensa-softmmu"
323 TEST_PY_ID: "--id qemu"
325 TOOLCHAIN: "xtensa-dc233c-elf"
326 <<: *buildman_and_testpy_dfn