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-20190720-02Aug2019
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 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
26 - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
28 - ( 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 )
30 - ( 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 )
33 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
35 # From buildman, exit code 129 means warnings only. If we've been asked to
36 # use clang only do one configuration.
37 - if [[ "${BUILDMAN}" != "" ]]; then
39 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
40 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
41 tools/buildman/buildman -sdeP ${BUILDMAN};
45 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
46 # never prevent any test from running. That way, we can always pass
47 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
49 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
50 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
51 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
52 if [[ "${TEST_PY_BD}" != "" ]]; then
53 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
54 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
55 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
57 if [[ $ret -ne 0 ]]; then
62 build all 32bit ARM plaforms:
67 ./tools/buildman/buildman -P -E arm -x aarch64 || ret=$?;
68 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
69 ./tools/buildman/buildman -sdeP;
73 build all 64bit ARM plaforms:
77 - virtualenv /tmp/venv
78 - . /tmp/venv/bin/activate
79 - pip install pyelftools
81 ./tools/buildman/buildman -P -E aarch64 || ret=$?;
82 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
83 ./tools/buildman/buildman -sdeP;
87 build all PowerPC plaforms:
92 ./tools/buildman/buildman -P -E powerpc || ret=$?;
93 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
94 ./tools/buildman/buildman -sdeP;
98 build all other plaforms:
103 ./tools/buildman/buildman -P -E -x arm,powerpc || ret=$?;
104 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
105 ./tools/buildman/buildman -sdeP;
109 # QA jobs for code analytics
110 # static code analysis with cppcheck (we can add --enable=all later)
115 - cppcheck --force --quiet --inline-suppr .
117 # search for TODO within source tree
118 grep TODO/FIXME/HACK:
124 # search for HACK within source tree and ignore HACKKIT board
125 - grep -r HACK . | grep -v HACKKIT
127 # some statistics about the code base
134 # ensure all configs have MAINTAINERS entries
135 Check for configs without MAINTAINERS entry:
139 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
141 # Ensure host tools build
146 - make tools-only_config tools-only -j$(nproc)
148 Run binman, buildman, dtoc and patman testsuites:
152 - git config --global user.name "GitLab CI Runner";
153 git config --global user.email trini@konsulko.com;
155 virtualenv /tmp/venv;
156 . /tmp/venv/bin/activate;
157 pip install pyelftools;
158 export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl;
159 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
160 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
161 ./tools/buildman/buildman -P sandbox_spl;
162 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
163 ./tools/buildman/buildman -t;
164 ./tools/dtoc/dtoc -t;
165 ./tools/patman/patman --test
167 # Test sandbox with test.py
171 TEST_PY_BD: "sandbox"
172 BUILDMAN: "^sandbox$"
173 <<: *buildman_and_testpy_dfn
178 TEST_PY_BD: "sandbox_spl"
179 BUILDMAN: "^sandbox_spl$"
180 TEST_PY_TEST_SPEC: "test_ofplatdata"
181 <<: *buildman_and_testpy_dfn
186 TEST_PY_BD: "evb-ast2500"
187 TEST_PY_ID: "--id qemu"
188 BUILDMAN: "^evb-ast2500$"
189 <<: *buildman_and_testpy_dfn
191 sandbox_flattree test.py:
194 TEST_PY_BD: "sandbox_flattree"
195 BUILDMAN: "^sandbox_flattree$"
196 <<: *buildman_and_testpy_dfn
198 vexpress_ca15_tc2 test.py:
201 TEST_PY_BD: "vexpress_ca15_tc2"
202 TEST_PY_ID: "--id qemu"
203 BUILDMAN: "^vexpress_ca15_tc2$"
204 <<: *buildman_and_testpy_dfn
206 vexpress_ca9x4 test.py:
209 TEST_PY_BD: "vexpress_ca9x4"
210 TEST_PY_ID: "--id qemu"
211 BUILDMAN: "^vexpress_ca9x4$"
212 <<: *buildman_and_testpy_dfn
214 integratorcp_cm926ejs test.py:
217 TEST_PY_BD: "integratorcp_cm926ejs"
218 TEST_PY_TEST_SPEC: "not sleep"
219 TEST_PY_ID: "--id qemu"
220 BUILDMAN: "^integratorcp_cm926ejs$"
221 <<: *buildman_and_testpy_dfn
226 TEST_PY_BD: "qemu_arm"
227 TEST_PY_TEST_SPEC: "not sleep"
228 BUILDMAN: "^qemu_arm$"
229 <<: *buildman_and_testpy_dfn
234 TEST_PY_BD: "qemu_arm64"
235 TEST_PY_TEST_SPEC: "not sleep"
236 BUILDMAN: "^qemu_arm64$"
237 <<: *buildman_and_testpy_dfn
242 TEST_PY_BD: "qemu_mips"
243 TEST_PY_TEST_SPEC: "not sleep"
244 BUILDMAN: "^qemu_mips$"
245 <<: *buildman_and_testpy_dfn
250 TEST_PY_BD: "qemu_mipsel"
251 TEST_PY_TEST_SPEC: "not sleep"
252 BUILDMAN: "^qemu_mipsel$"
253 <<: *buildman_and_testpy_dfn
258 TEST_PY_BD: "qemu_mips64"
259 TEST_PY_TEST_SPEC: "not sleep"
260 BUILDMAN: "^qemu_mips64$"
261 <<: *buildman_and_testpy_dfn
263 qemu_mips64el test.py:
266 TEST_PY_BD: "qemu_mips64el"
267 TEST_PY_TEST_SPEC: "not sleep"
268 BUILDMAN: "^qemu_mips64el$"
269 <<: *buildman_and_testpy_dfn
271 qemu-ppce500 test.py:
274 TEST_PY_BD: "qemu-ppce500"
275 TEST_PY_TEST_SPEC: "not sleep"
276 BUILDMAN: "^qemu-ppce500$"
277 <<: *buildman_and_testpy_dfn
279 qemu-riscv64 test.py:
282 TEST_PY_BD: "qemu-riscv64"
283 TEST_PY_TEST_SPEC: "not sleep"
284 BUILDMAN: "^qemu-riscv64$"
285 <<: *buildman_and_testpy_dfn
290 TEST_PY_BD: "qemu-x86"
291 TEST_PY_TEST_SPEC: "not sleep"
292 BUILDMAN: "^qemu-x86$"
293 <<: *buildman_and_testpy_dfn
298 TEST_PY_BD: "qemu-x86_64"
299 TEST_PY_TEST_SPEC: "not sleep"
300 BUILDMAN: "^qemu-x86_64$"
301 <<: *buildman_and_testpy_dfn
306 TEST_PY_BD: "zynq_zc702"
307 TEST_PY_TEST_SPEC: "not sleep"
308 TEST_PY_ID: "--id qemu"
309 BUILDMAN: "^zynq_zc702$"
310 <<: *buildman_and_testpy_dfn
312 xilinx_versal_virt test.py:
315 TEST_PY_BD: "xilinx_versal_virt"
316 TEST_PY_TEST_SPEC: "not sleep"
317 TEST_PY_ID: "--id qemu"
318 BUILDMAN: "^xilinx_versal_virt$"
319 <<: *buildman_and_testpy_dfn
325 TEST_PY_TEST_SPEC: "not sleep"
326 TEST_PY_ID: "--id qemu"
328 <<: *buildman_and_testpy_dfn