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:
193 TEST_PY_BD: "sandbox_noinst"
194 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
195 <<: *buildman_and_testpy_dfn
199 TEST_PY_BD: "evb-ast2500"
200 TEST_PY_ID: "--id qemu"
201 <<: *buildman_and_testpy_dfn
203 sandbox_flattree test.py:
205 TEST_PY_BD: "sandbox_flattree"
206 <<: *buildman_and_testpy_dfn
208 integratorcp_cm926ejs test.py:
210 TEST_PY_BD: "integratorcp_cm926ejs"
211 TEST_PY_TEST_SPEC: "not sleep"
212 TEST_PY_ID: "--id qemu"
213 <<: *buildman_and_testpy_dfn
217 TEST_PY_BD: "qemu_arm"
218 TEST_PY_TEST_SPEC: "not sleep"
219 <<: *buildman_and_testpy_dfn
223 TEST_PY_BD: "qemu_arm64"
224 TEST_PY_TEST_SPEC: "not sleep"
225 <<: *buildman_and_testpy_dfn
230 TEST_PY_TEST_SPEC: "not sleep and not efi"
231 TEST_PY_ID: "--id qemu"
232 <<: *buildman_and_testpy_dfn
234 qemu_maltael test.py:
236 TEST_PY_BD: "maltael"
237 TEST_PY_TEST_SPEC: "not sleep and not efi"
238 TEST_PY_ID: "--id qemu"
239 <<: *buildman_and_testpy_dfn
241 qemu_malta64 test.py:
243 TEST_PY_BD: "malta64"
244 TEST_PY_TEST_SPEC: "not sleep and not efi"
245 TEST_PY_ID: "--id qemu"
246 <<: *buildman_and_testpy_dfn
248 qemu_malta64el test.py:
250 TEST_PY_BD: "malta64el"
251 TEST_PY_TEST_SPEC: "not sleep and not efi"
252 TEST_PY_ID: "--id qemu"
253 <<: *buildman_and_testpy_dfn
255 qemu-ppce500 test.py:
257 TEST_PY_BD: "qemu-ppce500"
258 TEST_PY_TEST_SPEC: "not sleep"
259 <<: *buildman_and_testpy_dfn
261 qemu-riscv32 test.py:
263 TEST_PY_BD: "qemu-riscv32"
264 TEST_PY_TEST_SPEC: "not sleep"
265 <<: *buildman_and_testpy_dfn
267 qemu-riscv64 test.py:
269 TEST_PY_BD: "qemu-riscv64"
270 TEST_PY_TEST_SPEC: "not sleep"
271 <<: *buildman_and_testpy_dfn
273 qemu-riscv32_spl test.py:
275 TEST_PY_BD: "qemu-riscv32_spl"
276 TEST_PY_TEST_SPEC: "not sleep"
277 <<: *buildman_and_testpy_dfn
279 qemu-riscv64_spl test.py:
281 TEST_PY_BD: "qemu-riscv64_spl"
282 TEST_PY_TEST_SPEC: "not sleep"
283 <<: *buildman_and_testpy_dfn
287 TEST_PY_BD: "qemu-x86"
288 TEST_PY_TEST_SPEC: "not sleep"
289 <<: *buildman_and_testpy_dfn
293 TEST_PY_BD: "qemu-x86_64"
294 TEST_PY_TEST_SPEC: "not sleep"
295 <<: *buildman_and_testpy_dfn
297 r2dplus_i82557c test.py:
299 TEST_PY_BD: "r2dplus"
300 TEST_PY_ID: "--id i82557c_qemu"
301 <<: *buildman_and_testpy_dfn
303 r2dplus_pcnet test.py:
305 TEST_PY_BD: "r2dplus"
306 TEST_PY_ID: "--id pcnet_qemu"
307 <<: *buildman_and_testpy_dfn
309 r2dplus_rtl8139 test.py:
311 TEST_PY_BD: "r2dplus"
312 TEST_PY_ID: "--id rtl8139_qemu"
313 <<: *buildman_and_testpy_dfn
315 r2dplus_tulip test.py:
317 TEST_PY_BD: "r2dplus"
318 TEST_PY_ID: "--id tulip_qemu"
319 <<: *buildman_and_testpy_dfn
321 xilinx_zynq_virt test.py:
323 TEST_PY_BD: "xilinx_zynq_virt"
324 TEST_PY_TEST_SPEC: "not sleep"
325 TEST_PY_ID: "--id qemu"
326 <<: *buildman_and_testpy_dfn
328 xilinx_versal_virt test.py:
330 TEST_PY_BD: "xilinx_versal_virt"
331 TEST_PY_TEST_SPEC: "not sleep"
332 TEST_PY_ID: "--id qemu"
333 <<: *buildman_and_testpy_dfn
338 TEST_PY_TEST_SPEC: "not sleep"
339 TEST_PY_ID: "--id qemu"
340 <<: *buildman_and_testpy_dfn