1 # SPDX-License-Identifier: GPL-2.0+
3 # Grab our configured image. The source for this is found at:
4 # https://source.denx.de/u-boot/gitlab-ci-runner
5 image: trini/u-boot-gitlab-ci-runner:bionic-20200807-02Sep2020
7 # We run some tests in different order, to catch some failures quicker.
13 .buildman_and_testpy_template: &buildman_and_testpy_dfn
16 # Clone uboot-test-hooks
17 - git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
18 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
19 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
20 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
21 - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
22 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
23 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
24 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
26 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
27 wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
28 export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
32 - rm -rf /tmp/uboot-test-hooks /tmp/venv
34 # If we've been asked to use clang only do one configuration.
35 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
36 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
37 --board ${TEST_PY_BD} ${OVERRIDE}
38 - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
39 - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
40 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
41 - cp /opt/grub/grubriscv32.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv32.efi
42 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
43 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
44 - virtualenv -p /usr/bin/python3 /tmp/venv
45 - . /tmp/venv/bin/activate
46 - pip install -r test/py/requirements.txt
47 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
48 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
49 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
50 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
51 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
52 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
54 build all 32bit ARM platforms:
58 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
59 if [[ $ret -ne 0 ]]; then
60 ./tools/buildman/buildman -o /tmp -seP;
64 build all 64bit ARM platforms:
67 - virtualenv -p /usr/bin/python3 /tmp/venv
68 - . /tmp/venv/bin/activate
69 - pip install pyelftools
71 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
72 if [[ $ret -ne 0 ]]; then
73 ./tools/buildman/buildman -o /tmp -seP;
77 build all PowerPC platforms:
81 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
82 if [[ $ret -ne 0 ]]; then
83 ./tools/buildman/buildman -o /tmp -seP;
87 build all other platforms:
91 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
92 if [[ $ret -ne 0 ]]; then
93 ./tools/buildman/buildman -o /tmp -seP;
97 # QA jobs for code analytics
98 # static code analysis with cppcheck (we can add --enable=all later)
102 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
104 # search for TODO within source tree
105 grep TODO/FIXME/HACK:
110 # search for HACK within source tree and ignore HACKKIT board
111 - grep -r HACK . | grep -v HACKKIT
113 # build HTML documentation
117 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
118 - . /tmp/venvhtml/bin/activate
119 - pip install -r doc/sphinx/requirements.txt
122 # some statistics about the code base
128 # ensure all configs have MAINTAINERS entries
129 Check for configs without MAINTAINERS entry:
132 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
134 # Ensure host tools build
138 - make tools-only_config tools-only -j$(nproc)
140 # Ensure env tools build
144 - make tools-only_config envtools -j$(nproc)
146 Run binman, buildman, dtoc, Kconfig and patman testsuites:
149 - git config --global user.name "GitLab CI Runner";
150 git config --global user.email trini@konsulko.com;
152 virtualenv -p /usr/bin/python3 /tmp/venv;
153 . /tmp/venv/bin/activate;
154 pip install -r test/py/requirements.txt;
155 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
156 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
157 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
158 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
160 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
161 ./tools/buildman/buildman -t;
162 ./tools/dtoc/dtoc -t;
163 ./tools/patman/patman test;
166 Run tests for Nokia RX-51 (aka N900):
169 - ./tools/buildman/buildman --fetch-arch arm;
170 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
171 test/nokia_rx51_test.sh
173 # Test sandbox with test.py
176 TEST_PY_BD: "sandbox"
177 <<: *buildman_and_testpy_dfn
179 sandbox with clang test.py:
181 TEST_PY_BD: "sandbox"
182 OVERRIDE: "-O clang-10"
183 <<: *buildman_and_testpy_dfn
187 TEST_PY_BD: "sandbox_spl"
188 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
189 <<: *buildman_and_testpy_dfn
191 sandbox_noinst_test.py:
194 TEST_PY_BD: "sandbox_noinst"
195 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
196 <<: *buildman_and_testpy_dfn
200 TEST_PY_BD: "evb-ast2500"
201 TEST_PY_ID: "--id qemu"
202 <<: *buildman_and_testpy_dfn
204 sandbox_flattree test.py:
206 TEST_PY_BD: "sandbox_flattree"
207 <<: *buildman_and_testpy_dfn
209 integratorcp_cm926ejs test.py:
211 TEST_PY_BD: "integratorcp_cm926ejs"
212 TEST_PY_TEST_SPEC: "not sleep"
213 TEST_PY_ID: "--id qemu"
214 <<: *buildman_and_testpy_dfn
218 TEST_PY_BD: "qemu_arm"
219 TEST_PY_TEST_SPEC: "not sleep"
220 <<: *buildman_and_testpy_dfn
224 TEST_PY_BD: "qemu_arm64"
225 TEST_PY_TEST_SPEC: "not sleep"
226 <<: *buildman_and_testpy_dfn
230 TEST_PY_BD: "qemu_mips"
231 TEST_PY_TEST_SPEC: "not sleep"
232 <<: *buildman_and_testpy_dfn
236 TEST_PY_BD: "qemu_mipsel"
237 TEST_PY_TEST_SPEC: "not sleep"
238 <<: *buildman_and_testpy_dfn
242 TEST_PY_BD: "qemu_mips64"
243 TEST_PY_TEST_SPEC: "not sleep"
244 <<: *buildman_and_testpy_dfn
246 qemu_mips64el test.py:
248 TEST_PY_BD: "qemu_mips64el"
249 TEST_PY_TEST_SPEC: "not sleep"
250 <<: *buildman_and_testpy_dfn
255 TEST_PY_TEST_SPEC: "not sleep and not efi"
256 TEST_PY_ID: "--id qemu"
257 <<: *buildman_and_testpy_dfn
259 qemu_maltael test.py:
261 TEST_PY_BD: "maltael"
262 TEST_PY_TEST_SPEC: "not sleep and not efi"
263 TEST_PY_ID: "--id qemu"
264 <<: *buildman_and_testpy_dfn
266 qemu_malta64 test.py:
268 TEST_PY_BD: "malta64"
269 TEST_PY_TEST_SPEC: "not sleep and not efi"
270 TEST_PY_ID: "--id qemu"
271 <<: *buildman_and_testpy_dfn
273 qemu_malta64el test.py:
275 TEST_PY_BD: "malta64el"
276 TEST_PY_TEST_SPEC: "not sleep and not efi"
277 TEST_PY_ID: "--id qemu"
278 <<: *buildman_and_testpy_dfn
280 qemu-ppce500 test.py:
282 TEST_PY_BD: "qemu-ppce500"
283 TEST_PY_TEST_SPEC: "not sleep"
284 <<: *buildman_and_testpy_dfn
286 qemu-riscv32 test.py:
288 TEST_PY_BD: "qemu-riscv32"
289 TEST_PY_TEST_SPEC: "not sleep"
290 <<: *buildman_and_testpy_dfn
292 qemu-riscv64 test.py:
294 TEST_PY_BD: "qemu-riscv64"
295 TEST_PY_TEST_SPEC: "not sleep"
296 <<: *buildman_and_testpy_dfn
298 qemu-riscv32_spl test.py:
300 TEST_PY_BD: "qemu-riscv32_spl"
301 TEST_PY_TEST_SPEC: "not sleep"
302 <<: *buildman_and_testpy_dfn
304 qemu-riscv64_spl test.py:
306 TEST_PY_BD: "qemu-riscv64_spl"
307 TEST_PY_TEST_SPEC: "not sleep"
308 <<: *buildman_and_testpy_dfn
312 TEST_PY_BD: "qemu-x86"
313 TEST_PY_TEST_SPEC: "not sleep"
314 <<: *buildman_and_testpy_dfn
318 TEST_PY_BD: "qemu-x86_64"
319 TEST_PY_TEST_SPEC: "not sleep"
320 <<: *buildman_and_testpy_dfn
322 r2dplus_i82557c test.py:
324 TEST_PY_BD: "r2dplus"
325 TEST_PY_ID: "--id i82557c_qemu"
326 <<: *buildman_and_testpy_dfn
328 r2dplus_pcnet test.py:
330 TEST_PY_BD: "r2dplus"
331 TEST_PY_ID: "--id pcnet_qemu"
332 <<: *buildman_and_testpy_dfn
334 r2dplus_rtl8139 test.py:
336 TEST_PY_BD: "r2dplus"
337 TEST_PY_ID: "--id rtl8139_qemu"
338 <<: *buildman_and_testpy_dfn
340 r2dplus_tulip test.py:
342 TEST_PY_BD: "r2dplus"
343 TEST_PY_ID: "--id tulip_qemu"
344 <<: *buildman_and_testpy_dfn
346 xilinx_zynq_virt test.py:
348 TEST_PY_BD: "xilinx_zynq_virt"
349 TEST_PY_TEST_SPEC: "not sleep"
350 TEST_PY_ID: "--id qemu"
351 <<: *buildman_and_testpy_dfn
353 xilinx_versal_virt test.py:
355 TEST_PY_BD: "xilinx_versal_virt"
356 TEST_PY_TEST_SPEC: "not sleep"
357 TEST_PY_ID: "--id qemu"
358 <<: *buildman_and_testpy_dfn
363 TEST_PY_TEST_SPEC: "not sleep"
364 TEST_PY_ID: "--id qemu"
365 <<: *buildman_and_testpy_dfn