blob: 4b0680887b5644e0cf550861391ffcab220aad3b [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:
4# https://gitlab.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
14 tags: [ 'all' ]
15 stage: test.py
16 before_script:
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`
Tom Rini28a51232019-10-04 12:12:54 -040021 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
22 - 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 -070023 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
Bin Mengd20d0a52020-07-19 20:52:23 -070024 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
25 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
Bin Meng49fb28a2020-03-28 07:25:29 -070026 fi
27 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
Bin Mengd20d0a52020-07-19 20:52:23 -070028 wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
29 export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
Bin Meng49fb28a2020-03-28 07:25:29 -070030 fi
Tom Rinib29cb052019-07-24 13:09:31 -040031
Tom Rini1a62a722019-06-19 09:25:17 -040032 after_script:
Heinrich Schuchardt24df1b12019-12-19 13:30:32 +010033 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rini1a62a722019-06-19 09:25:17 -040034 script:
Simon Glassdd5c9542020-03-18 09:42:57 -060035 # If we've been asked to use clang only do one configuration.
Simon Glass4e32fed2020-03-18 09:42:55 -060036 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
Simon Glass7ec12552020-03-18 09:43:00 -060037 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
38 --board ${TEST_PY_BD} ${OVERRIDE}
Heinrich Schuchardt82560ae2020-07-14 00:23:58 +020039 - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
40 - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
41 - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
42 - cp /opt/grub/grubriscv32.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv32.efi
43 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
44 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
Tom Rini085b8972019-10-24 11:59:27 -040045 - virtualenv -p /usr/bin/python3 /tmp/venv
46 - . /tmp/venv/bin/activate
47 - pip install -r test/py/requirements.txt
Simon Glass4080d092020-03-18 09:42:56 -060048 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
Simon Glass4e32fed2020-03-18 09:42:55 -060049 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rini1a62a722019-06-19 09:25:17 -040050 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Heinrich Schuchardtf3092472020-07-10 22:04:40 +020051 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
Simon Glass4080d092020-03-18 09:42:56 -060052 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
Simon Glasscec1e852020-03-18 09:42:59 -060053 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
Tom Rini1a62a722019-06-19 09:25:17 -040054
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020055build all 32bit ARM platforms:
Tom Rini1a62a722019-06-19 09:25:17 -040056 tags: [ 'all' ]
57 stage: world build
58 script:
59 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060060 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
61 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060062 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040063 exit $ret;
64 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040065
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020066build all 64bit ARM platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040067 tags: [ 'all' ]
68 stage: world build
69 script:
Tom Rini26a426a2020-02-11 12:41:14 -050070 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rinif0db8392019-07-18 07:28:36 -040071 - . /tmp/venv/bin/activate
72 - pip install pyelftools
Tom Rini9f7bda12019-07-17 17:51:28 -040073 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060074 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
75 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060076 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040077 exit $ret;
78 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040079
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020080build all PowerPC platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040081 tags: [ 'all' ]
82 stage: world build
83 script:
84 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060085 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
86 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060087 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040088 exit $ret;
89 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040090
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020091build all other platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040092 tags: [ 'all' ]
93 stage: world build
94 script:
95 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060096 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
97 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060098 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040099 exit $ret;
100 fi;
Tom Rini1a62a722019-06-19 09:25:17 -0400101
102# QA jobs for code analytics
103# static code analysis with cppcheck (we can add --enable=all later)
104cppcheck:
105 tags: [ 'all' ]
106 stage: testsuites
107 script:
Simon Glass4ee7f522020-04-05 14:35:43 -0600108 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
Tom Rini1a62a722019-06-19 09:25:17 -0400109
110# search for TODO within source tree
111grep TODO/FIXME/HACK:
112 tags: [ 'all' ]
113 stage: testsuites
114 script:
115 - grep -r TODO .
116 - grep -r FIXME .
117 # search for HACK within source tree and ignore HACKKIT board
118 - grep -r HACK . | grep -v HACKKIT
119
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100120# build HTML documentation
121htmldocs:
122 tags: [ 'all' ]
123 stage: testsuites
124 script:
125 - make htmldocs
126
Tom Rini1a62a722019-06-19 09:25:17 -0400127# some statistics about the code base
128sloccount:
129 tags: [ 'all' ]
130 stage: testsuites
131 script:
132 - sloccount .
133
134# ensure all configs have MAINTAINERS entries
135Check for configs without MAINTAINERS entry:
136 tags: [ 'all' ]
137 stage: testsuites
138 script:
139 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
140
141# Ensure host tools build
142Build tools-only:
143 tags: [ 'all' ]
144 stage: testsuites
145 script:
146 - make tools-only_config tools-only -j$(nproc)
147
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200148# Ensure env tools build
149Build envtools:
150 tags: [ 'all' ]
151 stage: testsuites
152 script:
153 - make tools-only_config envtools -j$(nproc)
154
Tom Rini72618332020-03-11 18:11:15 -0400155Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rini1a62a722019-06-19 09:25:17 -0400156 tags: [ 'all' ]
157 stage: testsuites
158 script:
Tom Rinid7ae9322019-08-12 10:09:08 -0400159 - git config --global user.name "GitLab CI Runner";
160 git config --global user.email trini@konsulko.com;
161 export USER=gitlab;
Tom Rini26a426a2020-02-11 12:41:14 -0500162 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rinid7ae9322019-08-12 10:09:08 -0400163 . /tmp/venv/bin/activate;
Simon Glassbd73bb42020-10-29 21:46:11 -0600164 pip install pyelftools pytest pygit2;
Simon Glassbf0a8132020-03-18 09:42:50 -0600165 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400166 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
167 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glassbf0a8132020-03-18 09:42:50 -0600168 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400169 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
170 ./tools/buildman/buildman -t;
171 ./tools/dtoc/dtoc -t;
Simon Glass6bb74de2020-07-05 21:41:55 -0600172 ./tools/patman/patman test;
Tom Rini72618332020-03-11 18:11:15 -0400173 make testconfig
Tom Rini1a62a722019-06-19 09:25:17 -0400174
Pali Rohár6cfd09d2020-05-17 14:38:22 +0200175Run tests for Nokia RX-51 (aka N900):
176 tags: [ 'all' ]
177 stage: testsuites
178 script:
179 - ./tools/buildman/buildman --fetch-arch arm;
180 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
181 test/nokia_rx51_test.sh
182
Tom Rini1a62a722019-06-19 09:25:17 -0400183# Test sandbox with test.py
184sandbox test.py:
185 tags: [ 'all' ]
186 variables:
187 TEST_PY_BD: "sandbox"
Tom Rini1a62a722019-06-19 09:25:17 -0400188 <<: *buildman_and_testpy_dfn
189
Tom Rini0219d012019-11-06 19:30:47 -0500190sandbox with clang test.py:
191 tags: [ 'all' ]
192 variables:
193 TEST_PY_BD: "sandbox"
Tom Rinic8790be2020-04-10 18:28:04 -0400194 OVERRIDE: "-O clang-10"
Tom Rini0219d012019-11-06 19:30:47 -0500195 <<: *buildman_and_testpy_dfn
196
Tom Rini1a62a722019-06-19 09:25:17 -0400197sandbox_spl test.py:
198 tags: [ 'all' ]
199 variables:
200 TEST_PY_BD: "sandbox_spl"
Simon Glassafb26ba2020-10-25 20:38:36 -0600201 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
Tom Rini1a62a722019-06-19 09:25:17 -0400202 <<: *buildman_and_testpy_dfn
203
Tom Rini699c0b92019-07-17 16:06:57 -0400204evb-ast2500 test.py:
205 tags: [ 'all' ]
206 variables:
207 TEST_PY_BD: "evb-ast2500"
208 TEST_PY_ID: "--id qemu"
Tom Rini699c0b92019-07-17 16:06:57 -0400209 <<: *buildman_and_testpy_dfn
210
Tom Rini1a62a722019-06-19 09:25:17 -0400211sandbox_flattree test.py:
212 tags: [ 'all' ]
213 variables:
214 TEST_PY_BD: "sandbox_flattree"
Tom Rini1a62a722019-06-19 09:25:17 -0400215 <<: *buildman_and_testpy_dfn
216
217vexpress_ca15_tc2 test.py:
218 tags: [ 'all' ]
219 variables:
220 TEST_PY_BD: "vexpress_ca15_tc2"
221 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400222 <<: *buildman_and_testpy_dfn
223
224vexpress_ca9x4 test.py:
225 tags: [ 'all' ]
226 variables:
227 TEST_PY_BD: "vexpress_ca9x4"
228 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400229 <<: *buildman_and_testpy_dfn
230
231integratorcp_cm926ejs test.py:
232 tags: [ 'all' ]
233 variables:
234 TEST_PY_BD: "integratorcp_cm926ejs"
235 TEST_PY_TEST_SPEC: "not sleep"
236 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400237 <<: *buildman_and_testpy_dfn
238
239qemu_arm test.py:
240 tags: [ 'all' ]
241 variables:
242 TEST_PY_BD: "qemu_arm"
243 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400244 <<: *buildman_and_testpy_dfn
245
246qemu_arm64 test.py:
247 tags: [ 'all' ]
248 variables:
249 TEST_PY_BD: "qemu_arm64"
250 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400251 <<: *buildman_and_testpy_dfn
252
253qemu_mips test.py:
254 tags: [ 'all' ]
255 variables:
256 TEST_PY_BD: "qemu_mips"
257 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400258 <<: *buildman_and_testpy_dfn
259
260qemu_mipsel test.py:
261 tags: [ 'all' ]
262 variables:
263 TEST_PY_BD: "qemu_mipsel"
264 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400265 <<: *buildman_and_testpy_dfn
266
267qemu_mips64 test.py:
268 tags: [ 'all' ]
269 variables:
270 TEST_PY_BD: "qemu_mips64"
271 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400272 <<: *buildman_and_testpy_dfn
273
274qemu_mips64el test.py:
275 tags: [ 'all' ]
276 variables:
277 TEST_PY_BD: "qemu_mips64el"
278 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400279 <<: *buildman_and_testpy_dfn
280
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200281qemu_malta test.py:
282 tags: [ 'all' ]
283 variables:
284 TEST_PY_BD: "malta"
285 TEST_PY_TEST_SPEC: "not sleep and not efi"
286 TEST_PY_ID: "--id qemu"
287 <<: *buildman_and_testpy_dfn
288
289qemu_maltael test.py:
290 tags: [ 'all' ]
291 variables:
292 TEST_PY_BD: "maltael"
293 TEST_PY_TEST_SPEC: "not sleep and not efi"
294 TEST_PY_ID: "--id qemu"
295 <<: *buildman_and_testpy_dfn
296
297qemu_malta64 test.py:
298 tags: [ 'all' ]
299 variables:
300 TEST_PY_BD: "malta64"
301 TEST_PY_TEST_SPEC: "not sleep and not efi"
302 TEST_PY_ID: "--id qemu"
303 <<: *buildman_and_testpy_dfn
304
305qemu_malta64el test.py:
306 tags: [ 'all' ]
307 variables:
308 TEST_PY_BD: "malta64el"
309 TEST_PY_TEST_SPEC: "not sleep and not efi"
310 TEST_PY_ID: "--id qemu"
311 <<: *buildman_and_testpy_dfn
312
Tom Rini1a62a722019-06-19 09:25:17 -0400313qemu-ppce500 test.py:
314 tags: [ 'all' ]
315 variables:
316 TEST_PY_BD: "qemu-ppce500"
317 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400318 <<: *buildman_and_testpy_dfn
319
Bin Menga379d332020-03-28 07:25:27 -0700320qemu-riscv32 test.py:
321 tags: [ 'all' ]
322 variables:
323 TEST_PY_BD: "qemu-riscv32"
324 TEST_PY_TEST_SPEC: "not sleep"
Bin Menga379d332020-03-28 07:25:27 -0700325 <<: *buildman_and_testpy_dfn
326
Tom Rini7298d822019-08-02 11:32:37 -0400327qemu-riscv64 test.py:
328 tags: [ 'all' ]
329 variables:
330 TEST_PY_BD: "qemu-riscv64"
331 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini7298d822019-08-02 11:32:37 -0400332 <<: *buildman_and_testpy_dfn
333
Bin Meng49fb28a2020-03-28 07:25:29 -0700334qemu-riscv32_spl test.py:
335 tags: [ 'all' ]
336 variables:
337 TEST_PY_BD: "qemu-riscv32_spl"
338 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700339 <<: *buildman_and_testpy_dfn
340
341qemu-riscv64_spl test.py:
342 tags: [ 'all' ]
343 variables:
344 TEST_PY_BD: "qemu-riscv64_spl"
345 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700346 <<: *buildman_and_testpy_dfn
347
Tom Rini1a62a722019-06-19 09:25:17 -0400348qemu-x86 test.py:
349 tags: [ 'all' ]
350 variables:
351 TEST_PY_BD: "qemu-x86"
352 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400353 <<: *buildman_and_testpy_dfn
354
355qemu-x86_64 test.py:
356 tags: [ 'all' ]
357 variables:
358 TEST_PY_BD: "qemu-x86_64"
359 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400360 <<: *buildman_and_testpy_dfn
361
Marek Vasut0e125752020-09-14 21:55:58 +0200362r2dplus_i82557c test.py:
363 tags: [ 'all' ]
364 variables:
365 TEST_PY_BD: "r2dplus"
366 TEST_PY_ID: "--id i82557c_qemu"
367 <<: *buildman_and_testpy_dfn
368
369r2dplus_pcnet test.py:
370 tags: [ 'all' ]
371 variables:
372 TEST_PY_BD: "r2dplus"
373 TEST_PY_ID: "--id pcnet_qemu"
374 <<: *buildman_and_testpy_dfn
375
376r2dplus_rtl8139 test.py:
377 tags: [ 'all' ]
378 variables:
379 TEST_PY_BD: "r2dplus"
380 TEST_PY_ID: "--id rtl8139_qemu"
381 <<: *buildman_and_testpy_dfn
382
383r2dplus_tulip test.py:
384 tags: [ 'all' ]
385 variables:
386 TEST_PY_BD: "r2dplus"
387 TEST_PY_ID: "--id tulip_qemu"
388 <<: *buildman_and_testpy_dfn
389
Michal Simekf7c6ee72020-02-13 15:03:29 +0100390xilinx_zynq_virt test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400391 tags: [ 'all' ]
392 variables:
Michal Simekf7c6ee72020-02-13 15:03:29 +0100393 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rini1a62a722019-06-19 09:25:17 -0400394 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400395 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400396 <<: *buildman_and_testpy_dfn
397
398xilinx_versal_virt test.py:
399 tags: [ 'all' ]
400 variables:
401 TEST_PY_BD: "xilinx_versal_virt"
402 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400403 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400404 <<: *buildman_and_testpy_dfn
405
406xtfpga test.py:
407 tags: [ 'all' ]
408 variables:
409 TEST_PY_BD: "xtfpga"
410 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400411 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400412 <<: *buildman_and_testpy_dfn