blob: d072e833a3de3533a13b58514bca98c8f7b782b0 [file] [log] [blame]
Tom Rini1a62a722019-06-19 09:25:17 -04001# SPDX-License-Identifier: GPL-2.0+
2
3# Grab our configured image. The source for this is found at:
Heinrich Schuchardta3bbd0b2021-02-24 13:19:04 +01004# https://source.denx.de/u-boot/gitlab-ci-runner
Tom Rini71490772020-09-02 09:22:29 -04005image: trini/u-boot-gitlab-ci-runner:bionic-20200807-02Sep2020
Tom Rini1a62a722019-06-19 09:25:17 -04006
7# We run some tests in different order, to catch some failures quicker.
8stages:
Tom Rini1a62a722019-06-19 09:25:17 -04009 - testsuites
Tom Rinib29cb052019-07-24 13:09:31 -040010 - test.py
Tom Rini1a62a722019-06-19 09:25:17 -040011 - world build
12
13.buildman_and_testpy_template: &buildman_and_testpy_dfn
Tom Rini1a62a722019-06-19 09:25:17 -040014 stage: test.py
15 before_script:
16 # Clone uboot-test-hooks
Tom Rini85ae52b2021-02-24 17:05:04 -050017 - git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks
Tom Rini1a62a722019-06-19 09:25:17 -040018 - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
19 - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
Tom Rini28a51232019-10-04 12:12:54 -040020 - 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
Bin Meng49fb28a2020-03-28 07:25:29 -070022 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
Heinrich Schuchardtb6b35fd2021-04-02 11:42:01 +020023 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;
Bin Meng49fb28a2020-03-28 07:25:29 -070025 fi
26 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
Heinrich Schuchardtb6b35fd2021-04-02 11:42:01 +020027 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;
Bin Meng49fb28a2020-03-28 07:25:29 -070029 fi
Tom Rinib29cb052019-07-24 13:09:31 -040030
Tom Rini1a62a722019-06-19 09:25:17 -040031 after_script:
Heinrich Schuchardt24df1b12019-12-19 13:30:32 +010032 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rini1a62a722019-06-19 09:25:17 -040033 script:
Simon Glassdd5c9542020-03-18 09:42:57 -060034 # If we've been asked to use clang only do one configuration.
Simon Glass4e32fed2020-03-18 09:42:55 -060035 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
Simon Glass7ec12552020-03-18 09:43:00 -060036 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
37 --board ${TEST_PY_BD} ${OVERRIDE}
Heinrich Schuchardt82560ae2020-07-14 00:23:58 +020038 - 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
Tom Rini085b8972019-10-24 11:59:27 -040044 - virtualenv -p /usr/bin/python3 /tmp/venv
45 - . /tmp/venv/bin/activate
46 - pip install -r test/py/requirements.txt
Simon Glass4080d092020-03-18 09:42:56 -060047 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
Simon Glass4e32fed2020-03-18 09:42:55 -060048 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rini1a62a722019-06-19 09:25:17 -040049 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Heinrich Schuchardtf3092472020-07-10 22:04:40 +020050 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
Simon Glass4080d092020-03-18 09:42:56 -060051 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
Simon Glasscec1e852020-03-18 09:42:59 -060052 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
Tom Rini1a62a722019-06-19 09:25:17 -040053
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020054build all 32bit ARM platforms:
Tom Rini1a62a722019-06-19 09:25:17 -040055 stage: world build
56 script:
57 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060058 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
59 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060060 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040061 exit $ret;
62 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040063
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020064build all 64bit ARM platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040065 stage: world build
66 script:
Tom Rini26a426a2020-02-11 12:41:14 -050067 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rinif0db8392019-07-18 07:28:36 -040068 - . /tmp/venv/bin/activate
69 - pip install pyelftools
Tom Rini9f7bda12019-07-17 17:51:28 -040070 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060071 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
72 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060073 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040074 exit $ret;
75 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040076
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020077build all PowerPC platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040078 stage: world build
79 script:
80 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060081 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
82 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060083 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040084 exit $ret;
85 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040086
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020087build all other platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040088 stage: world build
89 script:
90 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060091 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
92 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060093 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040094 exit $ret;
95 fi;
Tom Rini1a62a722019-06-19 09:25:17 -040096
97# QA jobs for code analytics
98# static code analysis with cppcheck (we can add --enable=all later)
99cppcheck:
Tom Rini1a62a722019-06-19 09:25:17 -0400100 stage: testsuites
101 script:
Simon Glass4ee7f522020-04-05 14:35:43 -0600102 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
Tom Rini1a62a722019-06-19 09:25:17 -0400103
104# search for TODO within source tree
105grep TODO/FIXME/HACK:
Tom Rini1a62a722019-06-19 09:25:17 -0400106 stage: testsuites
107 script:
108 - grep -r TODO .
109 - grep -r FIXME .
110 # search for HACK within source tree and ignore HACKKIT board
111 - grep -r HACK . | grep -v HACKKIT
112
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100113# build HTML documentation
114htmldocs:
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100115 stage: testsuites
116 script:
Heinrich Schuchardt836049d2021-01-25 22:06:25 +0100117 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
118 - . /tmp/venvhtml/bin/activate
119 - pip install -r doc/sphinx/requirements.txt
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100120 - make htmldocs
121
Tom Rini1a62a722019-06-19 09:25:17 -0400122# some statistics about the code base
123sloccount:
Tom Rini1a62a722019-06-19 09:25:17 -0400124 stage: testsuites
125 script:
126 - sloccount .
127
128# ensure all configs have MAINTAINERS entries
129Check for configs without MAINTAINERS entry:
Tom Rini1a62a722019-06-19 09:25:17 -0400130 stage: testsuites
131 script:
132 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
133
134# Ensure host tools build
135Build tools-only:
Tom Rini1a62a722019-06-19 09:25:17 -0400136 stage: testsuites
137 script:
138 - make tools-only_config tools-only -j$(nproc)
139
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200140# Ensure env tools build
141Build envtools:
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200142 stage: testsuites
143 script:
144 - make tools-only_config envtools -j$(nproc)
145
Tom Rini72618332020-03-11 18:11:15 -0400146Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rini1a62a722019-06-19 09:25:17 -0400147 stage: testsuites
148 script:
Tom Rinid7ae9322019-08-12 10:09:08 -0400149 - git config --global user.name "GitLab CI Runner";
150 git config --global user.email trini@konsulko.com;
151 export USER=gitlab;
Tom Rini26a426a2020-02-11 12:41:14 -0500152 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rinid7ae9322019-08-12 10:09:08 -0400153 . /tmp/venv/bin/activate;
Tom Rini38229b52021-02-26 07:52:29 -0500154 pip install -r test/py/requirements.txt;
Simon Glassbf0a8132020-03-18 09:42:50 -0600155 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400156 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
157 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass6c914e42021-03-15 17:25:34 +1300158 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
159 --board sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400160 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
161 ./tools/buildman/buildman -t;
162 ./tools/dtoc/dtoc -t;
Simon Glass6bb74de2020-07-05 21:41:55 -0600163 ./tools/patman/patman test;
Tom Rini72618332020-03-11 18:11:15 -0400164 make testconfig
Tom Rini1a62a722019-06-19 09:25:17 -0400165
Pali Rohár6cfd09d2020-05-17 14:38:22 +0200166Run tests for Nokia RX-51 (aka N900):
Pali Rohár6cfd09d2020-05-17 14:38:22 +0200167 stage: testsuites
168 script:
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
172
Tom Rini1a62a722019-06-19 09:25:17 -0400173# Test sandbox with test.py
174sandbox test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400175 variables:
176 TEST_PY_BD: "sandbox"
Tom Rini1a62a722019-06-19 09:25:17 -0400177 <<: *buildman_and_testpy_dfn
178
Tom Rini0219d012019-11-06 19:30:47 -0500179sandbox with clang test.py:
Tom Rini0219d012019-11-06 19:30:47 -0500180 variables:
181 TEST_PY_BD: "sandbox"
Tom Rinic8790be2020-04-10 18:28:04 -0400182 OVERRIDE: "-O clang-10"
Tom Rini0219d012019-11-06 19:30:47 -0500183 <<: *buildman_and_testpy_dfn
184
Tom Rini1a62a722019-06-19 09:25:17 -0400185sandbox_spl test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400186 variables:
187 TEST_PY_BD: "sandbox_spl"
Simon Glassafb26ba2020-10-25 20:38:36 -0600188 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
Tom Rini1a62a722019-06-19 09:25:17 -0400189 <<: *buildman_and_testpy_dfn
190
Simon Glass6c914e42021-03-15 17:25:34 +1300191sandbox_noinst_test.py:
Simon Glass6c914e42021-03-15 17:25:34 +1300192 variables:
193 TEST_PY_BD: "sandbox_noinst"
194 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
195 <<: *buildman_and_testpy_dfn
196
Tom Rini699c0b92019-07-17 16:06:57 -0400197evb-ast2500 test.py:
Tom Rini699c0b92019-07-17 16:06:57 -0400198 variables:
199 TEST_PY_BD: "evb-ast2500"
200 TEST_PY_ID: "--id qemu"
Tom Rini699c0b92019-07-17 16:06:57 -0400201 <<: *buildman_and_testpy_dfn
202
Tom Rini1a62a722019-06-19 09:25:17 -0400203sandbox_flattree test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400204 variables:
205 TEST_PY_BD: "sandbox_flattree"
Tom Rini1a62a722019-06-19 09:25:17 -0400206 <<: *buildman_and_testpy_dfn
207
Tom Rini1a62a722019-06-19 09:25:17 -0400208integratorcp_cm926ejs test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400209 variables:
210 TEST_PY_BD: "integratorcp_cm926ejs"
211 TEST_PY_TEST_SPEC: "not sleep"
212 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400213 <<: *buildman_and_testpy_dfn
214
215qemu_arm test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400216 variables:
217 TEST_PY_BD: "qemu_arm"
218 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400219 <<: *buildman_and_testpy_dfn
220
221qemu_arm64 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400222 variables:
223 TEST_PY_BD: "qemu_arm64"
224 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400225 <<: *buildman_and_testpy_dfn
226
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200227qemu_malta test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200228 variables:
229 TEST_PY_BD: "malta"
230 TEST_PY_TEST_SPEC: "not sleep and not efi"
231 TEST_PY_ID: "--id qemu"
232 <<: *buildman_and_testpy_dfn
233
234qemu_maltael test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200235 variables:
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
240
241qemu_malta64 test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200242 variables:
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
247
248qemu_malta64el test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200249 variables:
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
254
Tom Rini1a62a722019-06-19 09:25:17 -0400255qemu-ppce500 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400256 variables:
257 TEST_PY_BD: "qemu-ppce500"
258 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400259 <<: *buildman_and_testpy_dfn
260
Bin Menga379d332020-03-28 07:25:27 -0700261qemu-riscv32 test.py:
Bin Menga379d332020-03-28 07:25:27 -0700262 variables:
263 TEST_PY_BD: "qemu-riscv32"
264 TEST_PY_TEST_SPEC: "not sleep"
Bin Menga379d332020-03-28 07:25:27 -0700265 <<: *buildman_and_testpy_dfn
266
Tom Rini7298d822019-08-02 11:32:37 -0400267qemu-riscv64 test.py:
Tom Rini7298d822019-08-02 11:32:37 -0400268 variables:
269 TEST_PY_BD: "qemu-riscv64"
270 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini7298d822019-08-02 11:32:37 -0400271 <<: *buildman_and_testpy_dfn
272
Bin Meng49fb28a2020-03-28 07:25:29 -0700273qemu-riscv32_spl test.py:
Bin Meng49fb28a2020-03-28 07:25:29 -0700274 variables:
275 TEST_PY_BD: "qemu-riscv32_spl"
276 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700277 <<: *buildman_and_testpy_dfn
278
279qemu-riscv64_spl test.py:
Bin Meng49fb28a2020-03-28 07:25:29 -0700280 variables:
281 TEST_PY_BD: "qemu-riscv64_spl"
282 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700283 <<: *buildman_and_testpy_dfn
284
Tom Rini1a62a722019-06-19 09:25:17 -0400285qemu-x86 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400286 variables:
287 TEST_PY_BD: "qemu-x86"
288 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400289 <<: *buildman_and_testpy_dfn
290
291qemu-x86_64 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400292 variables:
293 TEST_PY_BD: "qemu-x86_64"
294 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400295 <<: *buildman_and_testpy_dfn
296
Marek Vasut0e125752020-09-14 21:55:58 +0200297r2dplus_i82557c test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200298 variables:
299 TEST_PY_BD: "r2dplus"
300 TEST_PY_ID: "--id i82557c_qemu"
301 <<: *buildman_and_testpy_dfn
302
303r2dplus_pcnet test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200304 variables:
305 TEST_PY_BD: "r2dplus"
306 TEST_PY_ID: "--id pcnet_qemu"
307 <<: *buildman_and_testpy_dfn
308
309r2dplus_rtl8139 test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200310 variables:
311 TEST_PY_BD: "r2dplus"
312 TEST_PY_ID: "--id rtl8139_qemu"
313 <<: *buildman_and_testpy_dfn
314
315r2dplus_tulip test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200316 variables:
317 TEST_PY_BD: "r2dplus"
318 TEST_PY_ID: "--id tulip_qemu"
319 <<: *buildman_and_testpy_dfn
320
Michal Simekf7c6ee72020-02-13 15:03:29 +0100321xilinx_zynq_virt test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400322 variables:
Michal Simekf7c6ee72020-02-13 15:03:29 +0100323 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rini1a62a722019-06-19 09:25:17 -0400324 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400325 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400326 <<: *buildman_and_testpy_dfn
327
328xilinx_versal_virt test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400329 variables:
330 TEST_PY_BD: "xilinx_versal_virt"
331 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400332 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400333 <<: *buildman_and_testpy_dfn
334
335xtfpga test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400336 variables:
337 TEST_PY_BD: "xtfpga"
338 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400339 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400340 <<: *buildman_and_testpy_dfn