blob: a685a7879d0d0829dd8c2a1a0be4ccbc91063e2e [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 Rini717e7792020-06-18 13:51:39 -04005image: trini/u-boot-gitlab-ci-runner:bionic-20200526-18Jun2020
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
Heinrich Schuchardt24df1b12019-12-19 13:30:32 +010023 - cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
Bin Menga379d332020-03-28 07:25:27 -070024 - cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
Heinrich Schuchardt24df1b12019-12-19 13:30:32 +010025 - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
26 - cp /opt/grub/grubarm.efi ~/grub_arm.efi
Bin Meng49fb28a2020-03-28 07:25:29 -070027 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
28 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv32-bin.tar.xz | tar -C /tmp -xJ;
29 export OPENSBI=/tmp/opensbi-0.6-rv32-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
30 fi
31 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
32 wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv64-bin.tar.xz | tar -C /tmp -xJ;
33 export OPENSBI=/tmp/opensbi-0.6-rv64-bin/platform/qemu/virt/firmware/fw_dynamic.bin;
34 fi
Tom Rinib29cb052019-07-24 13:09:31 -040035
Tom Rini1a62a722019-06-19 09:25:17 -040036 after_script:
Heinrich Schuchardt24df1b12019-12-19 13:30:32 +010037 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rini1a62a722019-06-19 09:25:17 -040038 script:
Simon Glassdd5c9542020-03-18 09:42:57 -060039 # If we've been asked to use clang only do one configuration.
Simon Glass4e32fed2020-03-18 09:42:55 -060040 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
Simon Glass7ec12552020-03-18 09:43:00 -060041 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
42 --board ${TEST_PY_BD} ${OVERRIDE}
Tom Rini085b8972019-10-24 11:59:27 -040043 - virtualenv -p /usr/bin/python3 /tmp/venv
44 - . /tmp/venv/bin/activate
45 - pip install -r test/py/requirements.txt
Simon Glass4080d092020-03-18 09:42:56 -060046 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
Simon Glass4e32fed2020-03-18 09:42:55 -060047 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rini1a62a722019-06-19 09:25:17 -040048 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Simon Glass5bd95d62020-03-18 09:42:54 -060049 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
Simon Glass4080d092020-03-18 09:42:56 -060050 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
Simon Glasscec1e852020-03-18 09:42:59 -060051 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
Tom Rini1a62a722019-06-19 09:25:17 -040052
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020053build all 32bit ARM platforms:
Tom Rini1a62a722019-06-19 09:25:17 -040054 tags: [ 'all' ]
55 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 tags: [ 'all' ]
66 stage: world build
67 script:
Tom Rini26a426a2020-02-11 12:41:14 -050068 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rinif0db8392019-07-18 07:28:36 -040069 - . /tmp/venv/bin/activate
70 - pip install pyelftools
Tom Rini9f7bda12019-07-17 17:51:28 -040071 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060072 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
73 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060074 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040075 exit $ret;
76 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040077
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020078build all PowerPC platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040079 tags: [ 'all' ]
80 stage: world build
81 script:
82 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060083 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
84 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060085 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040086 exit $ret;
87 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040088
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020089build all other platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040090 tags: [ 'all' ]
91 stage: world build
92 script:
93 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060094 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
95 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060096 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040097 exit $ret;
98 fi;
Tom Rini1a62a722019-06-19 09:25:17 -040099
100# QA jobs for code analytics
101# static code analysis with cppcheck (we can add --enable=all later)
102cppcheck:
103 tags: [ 'all' ]
104 stage: testsuites
105 script:
Simon Glass4ee7f522020-04-05 14:35:43 -0600106 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
Tom Rini1a62a722019-06-19 09:25:17 -0400107
108# search for TODO within source tree
109grep TODO/FIXME/HACK:
110 tags: [ 'all' ]
111 stage: testsuites
112 script:
113 - grep -r TODO .
114 - grep -r FIXME .
115 # search for HACK within source tree and ignore HACKKIT board
116 - grep -r HACK . | grep -v HACKKIT
117
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100118# build HTML documentation
119htmldocs:
120 tags: [ 'all' ]
121 stage: testsuites
122 script:
123 - make htmldocs
124
Tom Rini1a62a722019-06-19 09:25:17 -0400125# some statistics about the code base
126sloccount:
127 tags: [ 'all' ]
128 stage: testsuites
129 script:
130 - sloccount .
131
132# ensure all configs have MAINTAINERS entries
133Check for configs without MAINTAINERS entry:
134 tags: [ 'all' ]
135 stage: testsuites
136 script:
137 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
138
139# Ensure host tools build
140Build tools-only:
141 tags: [ 'all' ]
142 stage: testsuites
143 script:
144 - make tools-only_config tools-only -j$(nproc)
145
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200146# Ensure env tools build
147Build envtools:
148 tags: [ 'all' ]
149 stage: testsuites
150 script:
151 - make tools-only_config envtools -j$(nproc)
152
Tom Rini72618332020-03-11 18:11:15 -0400153Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rini1a62a722019-06-19 09:25:17 -0400154 tags: [ 'all' ]
155 stage: testsuites
156 script:
Tom Rinid7ae9322019-08-12 10:09:08 -0400157 - git config --global user.name "GitLab CI Runner";
158 git config --global user.email trini@konsulko.com;
159 export USER=gitlab;
Tom Rini26a426a2020-02-11 12:41:14 -0500160 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rinid7ae9322019-08-12 10:09:08 -0400161 . /tmp/venv/bin/activate;
Tom Rini72618332020-03-11 18:11:15 -0400162 pip install pyelftools pytest;
Simon Glassbf0a8132020-03-18 09:42:50 -0600163 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400164 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
165 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glassbf0a8132020-03-18 09:42:50 -0600166 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400167 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
168 ./tools/buildman/buildman -t;
169 ./tools/dtoc/dtoc -t;
Tom Rini72618332020-03-11 18:11:15 -0400170 ./tools/patman/patman --test;
171 make testconfig
Tom Rini1a62a722019-06-19 09:25:17 -0400172
Pali Rohár6cfd09d2020-05-17 14:38:22 +0200173Run tests for Nokia RX-51 (aka N900):
174 tags: [ 'all' ]
175 stage: testsuites
176 script:
177 - ./tools/buildman/buildman --fetch-arch arm;
178 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
179 test/nokia_rx51_test.sh
180
Tom Rini1a62a722019-06-19 09:25:17 -0400181# Test sandbox with test.py
182sandbox test.py:
183 tags: [ 'all' ]
184 variables:
185 TEST_PY_BD: "sandbox"
Tom Rini1a62a722019-06-19 09:25:17 -0400186 <<: *buildman_and_testpy_dfn
187
Tom Rini0219d012019-11-06 19:30:47 -0500188sandbox with clang test.py:
189 tags: [ 'all' ]
190 variables:
191 TEST_PY_BD: "sandbox"
Tom Rinic8790be2020-04-10 18:28:04 -0400192 OVERRIDE: "-O clang-10"
Tom Rini0219d012019-11-06 19:30:47 -0500193 <<: *buildman_and_testpy_dfn
194
Tom Rini1a62a722019-06-19 09:25:17 -0400195sandbox_spl test.py:
196 tags: [ 'all' ]
197 variables:
198 TEST_PY_BD: "sandbox_spl"
Simon Glasse28e9db2020-03-18 09:42:58 -0600199 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
Tom Rini1a62a722019-06-19 09:25:17 -0400200 <<: *buildman_and_testpy_dfn
201
Tom Rini699c0b92019-07-17 16:06:57 -0400202evb-ast2500 test.py:
203 tags: [ 'all' ]
204 variables:
205 TEST_PY_BD: "evb-ast2500"
206 TEST_PY_ID: "--id qemu"
Tom Rini699c0b92019-07-17 16:06:57 -0400207 <<: *buildman_and_testpy_dfn
208
Tom Rini1a62a722019-06-19 09:25:17 -0400209sandbox_flattree test.py:
210 tags: [ 'all' ]
211 variables:
212 TEST_PY_BD: "sandbox_flattree"
Tom Rini1a62a722019-06-19 09:25:17 -0400213 <<: *buildman_and_testpy_dfn
214
215vexpress_ca15_tc2 test.py:
216 tags: [ 'all' ]
217 variables:
218 TEST_PY_BD: "vexpress_ca15_tc2"
219 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400220 <<: *buildman_and_testpy_dfn
221
222vexpress_ca9x4 test.py:
223 tags: [ 'all' ]
224 variables:
225 TEST_PY_BD: "vexpress_ca9x4"
226 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400227 <<: *buildman_and_testpy_dfn
228
229integratorcp_cm926ejs test.py:
230 tags: [ 'all' ]
231 variables:
232 TEST_PY_BD: "integratorcp_cm926ejs"
233 TEST_PY_TEST_SPEC: "not sleep"
234 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400235 <<: *buildman_and_testpy_dfn
236
237qemu_arm test.py:
238 tags: [ 'all' ]
239 variables:
240 TEST_PY_BD: "qemu_arm"
241 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400242 <<: *buildman_and_testpy_dfn
243
244qemu_arm64 test.py:
245 tags: [ 'all' ]
246 variables:
247 TEST_PY_BD: "qemu_arm64"
248 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400249 <<: *buildman_and_testpy_dfn
250
251qemu_mips test.py:
252 tags: [ 'all' ]
253 variables:
254 TEST_PY_BD: "qemu_mips"
255 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400256 <<: *buildman_and_testpy_dfn
257
258qemu_mipsel test.py:
259 tags: [ 'all' ]
260 variables:
261 TEST_PY_BD: "qemu_mipsel"
262 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400263 <<: *buildman_and_testpy_dfn
264
265qemu_mips64 test.py:
266 tags: [ 'all' ]
267 variables:
268 TEST_PY_BD: "qemu_mips64"
269 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400270 <<: *buildman_and_testpy_dfn
271
272qemu_mips64el test.py:
273 tags: [ 'all' ]
274 variables:
275 TEST_PY_BD: "qemu_mips64el"
276 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400277 <<: *buildman_and_testpy_dfn
278
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200279qemu_malta test.py:
280 tags: [ 'all' ]
281 variables:
282 TEST_PY_BD: "malta"
283 TEST_PY_TEST_SPEC: "not sleep and not efi"
284 TEST_PY_ID: "--id qemu"
285 <<: *buildman_and_testpy_dfn
286
287qemu_maltael test.py:
288 tags: [ 'all' ]
289 variables:
290 TEST_PY_BD: "maltael"
291 TEST_PY_TEST_SPEC: "not sleep and not efi"
292 TEST_PY_ID: "--id qemu"
293 <<: *buildman_and_testpy_dfn
294
295qemu_malta64 test.py:
296 tags: [ 'all' ]
297 variables:
298 TEST_PY_BD: "malta64"
299 TEST_PY_TEST_SPEC: "not sleep and not efi"
300 TEST_PY_ID: "--id qemu"
301 <<: *buildman_and_testpy_dfn
302
303qemu_malta64el test.py:
304 tags: [ 'all' ]
305 variables:
306 TEST_PY_BD: "malta64el"
307 TEST_PY_TEST_SPEC: "not sleep and not efi"
308 TEST_PY_ID: "--id qemu"
309 <<: *buildman_and_testpy_dfn
310
Tom Rini1a62a722019-06-19 09:25:17 -0400311qemu-ppce500 test.py:
312 tags: [ 'all' ]
313 variables:
314 TEST_PY_BD: "qemu-ppce500"
315 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400316 <<: *buildman_and_testpy_dfn
317
Bin Menga379d332020-03-28 07:25:27 -0700318qemu-riscv32 test.py:
319 tags: [ 'all' ]
320 variables:
321 TEST_PY_BD: "qemu-riscv32"
322 TEST_PY_TEST_SPEC: "not sleep"
Bin Menga379d332020-03-28 07:25:27 -0700323 <<: *buildman_and_testpy_dfn
324
Tom Rini7298d822019-08-02 11:32:37 -0400325qemu-riscv64 test.py:
326 tags: [ 'all' ]
327 variables:
328 TEST_PY_BD: "qemu-riscv64"
329 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini7298d822019-08-02 11:32:37 -0400330 <<: *buildman_and_testpy_dfn
331
Bin Meng49fb28a2020-03-28 07:25:29 -0700332qemu-riscv32_spl test.py:
333 tags: [ 'all' ]
334 variables:
335 TEST_PY_BD: "qemu-riscv32_spl"
336 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700337 <<: *buildman_and_testpy_dfn
338
339qemu-riscv64_spl test.py:
340 tags: [ 'all' ]
341 variables:
342 TEST_PY_BD: "qemu-riscv64_spl"
343 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700344 <<: *buildman_and_testpy_dfn
345
Tom Rini1a62a722019-06-19 09:25:17 -0400346qemu-x86 test.py:
347 tags: [ 'all' ]
348 variables:
349 TEST_PY_BD: "qemu-x86"
350 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400351 <<: *buildman_and_testpy_dfn
352
353qemu-x86_64 test.py:
354 tags: [ 'all' ]
355 variables:
356 TEST_PY_BD: "qemu-x86_64"
357 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400358 <<: *buildman_and_testpy_dfn
359
Michal Simekf7c6ee72020-02-13 15:03:29 +0100360xilinx_zynq_virt test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400361 tags: [ 'all' ]
362 variables:
Michal Simekf7c6ee72020-02-13 15:03:29 +0100363 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rini1a62a722019-06-19 09:25:17 -0400364 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400365 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400366 <<: *buildman_and_testpy_dfn
367
368xilinx_versal_virt test.py:
369 tags: [ 'all' ]
370 variables:
371 TEST_PY_BD: "xilinx_versal_virt"
372 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400373 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400374 <<: *buildman_and_testpy_dfn
375
376xtfpga test.py:
377 tags: [ 'all' ]
378 variables:
379 TEST_PY_BD: "xtfpga"
380 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400381 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400382 <<: *buildman_and_testpy_dfn