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-20190912.1-03Oct2019
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
24 - pip install python-subunit
25 - pip install coverage
26 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
27 - grub-mkimage --prefix="" -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 )
34 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
36 # From buildman, exit code 129 means warnings only. If we've been asked to
37 # use clang only do one configuration.
38 - if [[ "${BUILDMAN}" != "" ]]; then
40 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
41 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
42 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
46 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
47 # never prevent any test from running. That way, we can always pass
48 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
50 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
51 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
52 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
53 if [[ "${TEST_PY_BD}" != "" ]]; then
54 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
55 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
56 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
58 if [[ $ret -ne 0 ]]; then
63 build all 32bit ARM platforms:
68 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
69 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
70 ./tools/buildman/buildman -o /tmp -sdeP;
74 build all 64bit ARM platforms:
78 - virtualenv /tmp/venv
79 - . /tmp/venv/bin/activate
80 - pip install pyelftools
82 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
83 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
84 ./tools/buildman/buildman -o /tmp -sdeP;
88 build all PowerPC platforms:
93 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
94 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
95 ./tools/buildman/buildman -o /tmp -sdeP;
99 build all other platforms:
104 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
105 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
106 ./tools/buildman/buildman -o /tmp -sdeP;
110 # QA jobs for code analytics
111 # static code analysis with cppcheck (we can add --enable=all later)
116 - cppcheck --force --quiet --inline-suppr .
118 # search for TODO within source tree
119 grep TODO/FIXME/HACK:
125 # search for HACK within source tree and ignore HACKKIT board
126 - grep -r HACK . | grep -v HACKKIT
128 # some statistics about the code base
135 # ensure all configs have MAINTAINERS entries
136 Check for configs without MAINTAINERS entry:
140 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
142 # Ensure host tools build
147 - make tools-only_config tools-only -j$(nproc)
149 # Ensure env tools build
154 - make tools-only_config envtools -j$(nproc)
156 Run binman, buildman, dtoc and patman testsuites:
160 - git config --global user.name "GitLab CI Runner";
161 git config --global user.email trini@konsulko.com;
163 virtualenv /tmp/venv;
164 . /tmp/venv/bin/activate;
165 pip install pyelftools;
166 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
167 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
168 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
169 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
170 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
171 ./tools/buildman/buildman -t;
172 ./tools/dtoc/dtoc -t;
173 ./tools/patman/patman --test
175 # Test sandbox with test.py
179 TEST_PY_BD: "sandbox"
180 BUILDMAN: "^sandbox$"
181 <<: *buildman_and_testpy_dfn
186 TEST_PY_BD: "sandbox_spl"
187 BUILDMAN: "^sandbox_spl$"
188 TEST_PY_TEST_SPEC: "test_ofplatdata"
189 <<: *buildman_and_testpy_dfn
194 TEST_PY_BD: "evb-ast2500"
195 TEST_PY_ID: "--id qemu"
196 BUILDMAN: "^evb-ast2500$"
197 <<: *buildman_and_testpy_dfn
199 sandbox_flattree test.py:
202 TEST_PY_BD: "sandbox_flattree"
203 BUILDMAN: "^sandbox_flattree$"
204 <<: *buildman_and_testpy_dfn
206 vexpress_ca15_tc2 test.py:
209 TEST_PY_BD: "vexpress_ca15_tc2"
210 TEST_PY_ID: "--id qemu"
211 BUILDMAN: "^vexpress_ca15_tc2$"
212 <<: *buildman_and_testpy_dfn
214 vexpress_ca9x4 test.py:
217 TEST_PY_BD: "vexpress_ca9x4"
218 TEST_PY_ID: "--id qemu"
219 BUILDMAN: "^vexpress_ca9x4$"
220 <<: *buildman_and_testpy_dfn
222 integratorcp_cm926ejs test.py:
225 TEST_PY_BD: "integratorcp_cm926ejs"
226 TEST_PY_TEST_SPEC: "not sleep"
227 TEST_PY_ID: "--id qemu"
228 BUILDMAN: "^integratorcp_cm926ejs$"
229 <<: *buildman_and_testpy_dfn
234 TEST_PY_BD: "qemu_arm"
235 TEST_PY_TEST_SPEC: "not sleep"
236 BUILDMAN: "^qemu_arm$"
237 <<: *buildman_and_testpy_dfn
242 TEST_PY_BD: "qemu_arm64"
243 TEST_PY_TEST_SPEC: "not sleep"
244 BUILDMAN: "^qemu_arm64$"
245 <<: *buildman_and_testpy_dfn
250 TEST_PY_BD: "qemu_mips"
251 TEST_PY_TEST_SPEC: "not sleep"
252 BUILDMAN: "^qemu_mips$"
253 <<: *buildman_and_testpy_dfn
258 TEST_PY_BD: "qemu_mipsel"
259 TEST_PY_TEST_SPEC: "not sleep"
260 BUILDMAN: "^qemu_mipsel$"
261 <<: *buildman_and_testpy_dfn
266 TEST_PY_BD: "qemu_mips64"
267 TEST_PY_TEST_SPEC: "not sleep"
268 BUILDMAN: "^qemu_mips64$"
269 <<: *buildman_and_testpy_dfn
271 qemu_mips64el test.py:
274 TEST_PY_BD: "qemu_mips64el"
275 TEST_PY_TEST_SPEC: "not sleep"
276 BUILDMAN: "^qemu_mips64el$"
277 <<: *buildman_and_testpy_dfn
279 qemu-ppce500 test.py:
282 TEST_PY_BD: "qemu-ppce500"
283 TEST_PY_TEST_SPEC: "not sleep"
284 BUILDMAN: "^qemu-ppce500$"
285 <<: *buildman_and_testpy_dfn
287 qemu-riscv64 test.py:
290 TEST_PY_BD: "qemu-riscv64"
291 TEST_PY_TEST_SPEC: "not sleep"
292 BUILDMAN: "^qemu-riscv64$"
293 <<: *buildman_and_testpy_dfn
298 TEST_PY_BD: "qemu-x86"
299 TEST_PY_TEST_SPEC: "not sleep"
300 BUILDMAN: "^qemu-x86$"
301 <<: *buildman_and_testpy_dfn
306 TEST_PY_BD: "qemu-x86_64"
307 TEST_PY_TEST_SPEC: "not sleep"
308 BUILDMAN: "^qemu-x86_64$"
309 <<: *buildman_and_testpy_dfn
314 TEST_PY_BD: "zynq_zc702"
315 TEST_PY_TEST_SPEC: "not sleep"
316 TEST_PY_ID: "--id qemu"
317 BUILDMAN: "^zynq_zc702$"
318 <<: *buildman_and_testpy_dfn
320 xilinx_versal_virt test.py:
323 TEST_PY_BD: "xilinx_versal_virt"
324 TEST_PY_TEST_SPEC: "not sleep"
325 TEST_PY_ID: "--id qemu"
326 BUILDMAN: "^xilinx_versal_virt$"
327 <<: *buildman_and_testpy_dfn
333 TEST_PY_TEST_SPEC: "not sleep"
334 TEST_PY_ID: "--id qemu"
336 <<: *buildman_and_testpy_dfn