blob: 86026a15f9da3ae8e2630e10d6acfe3409897939 [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 Rini7bb1cc32021-07-02 10:41:58 -04005image: trini/u-boot-gitlab-ci-runner:focal-20210609-06Jul2021
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
Heinrich Schuchardt82560ae2020-07-14 00:23:58 +020041 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
42 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
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;
Heinrich Schuchardtf3092472020-07-10 22:04:40 +020049 ./test/py/test.py -ra --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 stage: world build
55 script:
56 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060057 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
58 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060059 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040060 exit $ret;
61 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040062
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020063build all 64bit ARM platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040064 stage: world build
65 script:
Tom Rini26a426a2020-02-11 12:41:14 -050066 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rinif0db8392019-07-18 07:28:36 -040067 - . /tmp/venv/bin/activate
68 - pip install pyelftools
Tom Rini9f7bda12019-07-17 17:51:28 -040069 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060070 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
71 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060072 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040073 exit $ret;
74 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040075
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020076build all PowerPC platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040077 stage: world build
78 script:
79 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060080 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
81 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060082 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040083 exit $ret;
84 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040085
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020086build all other platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040087 stage: world build
88 script:
89 - ret=0;
Simon Glassdd5c9542020-03-18 09:42:57 -060090 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
91 if [[ $ret -ne 0 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060092 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040093 exit $ret;
94 fi;
Tom Rini1a62a722019-06-19 09:25:17 -040095
96# QA jobs for code analytics
97# static code analysis with cppcheck (we can add --enable=all later)
98cppcheck:
Tom Rini1a62a722019-06-19 09:25:17 -040099 stage: testsuites
100 script:
Simon Glass4ee7f522020-04-05 14:35:43 -0600101 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
Tom Rini1a62a722019-06-19 09:25:17 -0400102
103# search for TODO within source tree
104grep TODO/FIXME/HACK:
Tom Rini1a62a722019-06-19 09:25:17 -0400105 stage: testsuites
106 script:
107 - grep -r TODO .
108 - grep -r FIXME .
109 # search for HACK within source tree and ignore HACKKIT board
110 - grep -r HACK . | grep -v HACKKIT
111
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100112# build HTML documentation
113htmldocs:
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100114 stage: testsuites
115 script:
Heinrich Schuchardt836049d2021-01-25 22:06:25 +0100116 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
117 - . /tmp/venvhtml/bin/activate
118 - pip install -r doc/sphinx/requirements.txt
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100119 - make htmldocs
120
Tom Rini1a62a722019-06-19 09:25:17 -0400121# some statistics about the code base
122sloccount:
Tom Rini1a62a722019-06-19 09:25:17 -0400123 stage: testsuites
124 script:
125 - sloccount .
126
127# ensure all configs have MAINTAINERS entries
128Check for configs without MAINTAINERS entry:
Tom Rini1a62a722019-06-19 09:25:17 -0400129 stage: testsuites
130 script:
131 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
132
133# Ensure host tools build
134Build tools-only:
Tom Rini1a62a722019-06-19 09:25:17 -0400135 stage: testsuites
136 script:
137 - make tools-only_config tools-only -j$(nproc)
138
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200139# Ensure env tools build
140Build envtools:
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200141 stage: testsuites
142 script:
143 - make tools-only_config envtools -j$(nproc)
144
Tom Rini72618332020-03-11 18:11:15 -0400145Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rini1a62a722019-06-19 09:25:17 -0400146 stage: testsuites
147 script:
Tom Rinid7ae9322019-08-12 10:09:08 -0400148 - git config --global user.name "GitLab CI Runner";
149 git config --global user.email trini@konsulko.com;
150 export USER=gitlab;
Tom Rini26a426a2020-02-11 12:41:14 -0500151 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rinid7ae9322019-08-12 10:09:08 -0400152 . /tmp/venv/bin/activate;
Tom Rini38229b52021-02-26 07:52:29 -0500153 pip install -r test/py/requirements.txt;
Simon Glassbf0a8132020-03-18 09:42:50 -0600154 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400155 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
156 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass6c914e42021-03-15 17:25:34 +1300157 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
158 --board sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400159 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
160 ./tools/buildman/buildman -t;
161 ./tools/dtoc/dtoc -t;
Simon Glass6bb74de2020-07-05 21:41:55 -0600162 ./tools/patman/patman test;
Tom Rini72618332020-03-11 18:11:15 -0400163 make testconfig
Tom Rini1a62a722019-06-19 09:25:17 -0400164
Pali Rohár6cfd09d2020-05-17 14:38:22 +0200165Run tests for Nokia RX-51 (aka N900):
Pali Rohár6cfd09d2020-05-17 14:38:22 +0200166 stage: testsuites
167 script:
168 - ./tools/buildman/buildman --fetch-arch arm;
169 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
170 test/nokia_rx51_test.sh
171
Tom Rini1a62a722019-06-19 09:25:17 -0400172# Test sandbox with test.py
173sandbox test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400174 variables:
175 TEST_PY_BD: "sandbox"
Tom Rini1a62a722019-06-19 09:25:17 -0400176 <<: *buildman_and_testpy_dfn
177
Tom Rini0219d012019-11-06 19:30:47 -0500178sandbox with clang test.py:
Tom Rini0219d012019-11-06 19:30:47 -0500179 variables:
180 TEST_PY_BD: "sandbox"
Tom Rinic8790be2020-04-10 18:28:04 -0400181 OVERRIDE: "-O clang-10"
Tom Rini0219d012019-11-06 19:30:47 -0500182 <<: *buildman_and_testpy_dfn
183
Tom Rini1a62a722019-06-19 09:25:17 -0400184sandbox_spl test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400185 variables:
186 TEST_PY_BD: "sandbox_spl"
Simon Glassafb26ba2020-10-25 20:38:36 -0600187 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
Tom Rini1a62a722019-06-19 09:25:17 -0400188 <<: *buildman_and_testpy_dfn
189
Simon Glass6c914e42021-03-15 17:25:34 +1300190sandbox_noinst_test.py:
Simon Glass6c914e42021-03-15 17:25:34 +1300191 variables:
192 TEST_PY_BD: "sandbox_noinst"
193 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
194 <<: *buildman_and_testpy_dfn
195
Tom Rini699c0b92019-07-17 16:06:57 -0400196evb-ast2500 test.py:
Tom Rini699c0b92019-07-17 16:06:57 -0400197 variables:
198 TEST_PY_BD: "evb-ast2500"
199 TEST_PY_ID: "--id qemu"
Tom Rini699c0b92019-07-17 16:06:57 -0400200 <<: *buildman_and_testpy_dfn
201
Tom Rini1a62a722019-06-19 09:25:17 -0400202sandbox_flattree test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400203 variables:
204 TEST_PY_BD: "sandbox_flattree"
Tom Rini1a62a722019-06-19 09:25:17 -0400205 <<: *buildman_and_testpy_dfn
206
Tom Rini1a62a722019-06-19 09:25:17 -0400207integratorcp_cm926ejs test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400208 variables:
209 TEST_PY_BD: "integratorcp_cm926ejs"
210 TEST_PY_TEST_SPEC: "not sleep"
211 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400212 <<: *buildman_and_testpy_dfn
213
214qemu_arm test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400215 variables:
216 TEST_PY_BD: "qemu_arm"
217 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400218 <<: *buildman_and_testpy_dfn
219
220qemu_arm64 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400221 variables:
222 TEST_PY_BD: "qemu_arm64"
223 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400224 <<: *buildman_and_testpy_dfn
225
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200226qemu_malta test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200227 variables:
228 TEST_PY_BD: "malta"
229 TEST_PY_TEST_SPEC: "not sleep and not efi"
230 TEST_PY_ID: "--id qemu"
231 <<: *buildman_and_testpy_dfn
232
233qemu_maltael test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200234 variables:
235 TEST_PY_BD: "maltael"
236 TEST_PY_TEST_SPEC: "not sleep and not efi"
237 TEST_PY_ID: "--id qemu"
238 <<: *buildman_and_testpy_dfn
239
240qemu_malta64 test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200241 variables:
242 TEST_PY_BD: "malta64"
243 TEST_PY_TEST_SPEC: "not sleep and not efi"
244 TEST_PY_ID: "--id qemu"
245 <<: *buildman_and_testpy_dfn
246
247qemu_malta64el test.py:
Daniel Schwierzeckd8533162020-06-06 22:21:47 +0200248 variables:
249 TEST_PY_BD: "malta64el"
250 TEST_PY_TEST_SPEC: "not sleep and not efi"
251 TEST_PY_ID: "--id qemu"
252 <<: *buildman_and_testpy_dfn
253
Tom Rini1a62a722019-06-19 09:25:17 -0400254qemu-ppce500 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400255 variables:
256 TEST_PY_BD: "qemu-ppce500"
257 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400258 <<: *buildman_and_testpy_dfn
259
Bin Menga379d332020-03-28 07:25:27 -0700260qemu-riscv32 test.py:
Bin Menga379d332020-03-28 07:25:27 -0700261 variables:
262 TEST_PY_BD: "qemu-riscv32"
263 TEST_PY_TEST_SPEC: "not sleep"
Bin Menga379d332020-03-28 07:25:27 -0700264 <<: *buildman_and_testpy_dfn
265
Tom Rini7298d822019-08-02 11:32:37 -0400266qemu-riscv64 test.py:
Tom Rini7298d822019-08-02 11:32:37 -0400267 variables:
268 TEST_PY_BD: "qemu-riscv64"
269 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini7298d822019-08-02 11:32:37 -0400270 <<: *buildman_and_testpy_dfn
271
Bin Meng49fb28a2020-03-28 07:25:29 -0700272qemu-riscv32_spl test.py:
Bin Meng49fb28a2020-03-28 07:25:29 -0700273 variables:
274 TEST_PY_BD: "qemu-riscv32_spl"
275 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700276 <<: *buildman_and_testpy_dfn
277
278qemu-riscv64_spl test.py:
Bin Meng49fb28a2020-03-28 07:25:29 -0700279 variables:
280 TEST_PY_BD: "qemu-riscv64_spl"
281 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700282 <<: *buildman_and_testpy_dfn
283
Tom Rini1a62a722019-06-19 09:25:17 -0400284qemu-x86 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400285 variables:
286 TEST_PY_BD: "qemu-x86"
287 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400288 <<: *buildman_and_testpy_dfn
289
290qemu-x86_64 test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400291 variables:
292 TEST_PY_BD: "qemu-x86_64"
293 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400294 <<: *buildman_and_testpy_dfn
295
Marek Vasut0e125752020-09-14 21:55:58 +0200296r2dplus_i82557c test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200297 variables:
298 TEST_PY_BD: "r2dplus"
299 TEST_PY_ID: "--id i82557c_qemu"
300 <<: *buildman_and_testpy_dfn
301
302r2dplus_pcnet test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200303 variables:
304 TEST_PY_BD: "r2dplus"
305 TEST_PY_ID: "--id pcnet_qemu"
306 <<: *buildman_and_testpy_dfn
307
308r2dplus_rtl8139 test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200309 variables:
310 TEST_PY_BD: "r2dplus"
311 TEST_PY_ID: "--id rtl8139_qemu"
312 <<: *buildman_and_testpy_dfn
313
314r2dplus_tulip test.py:
Marek Vasut0e125752020-09-14 21:55:58 +0200315 variables:
316 TEST_PY_BD: "r2dplus"
317 TEST_PY_ID: "--id tulip_qemu"
318 <<: *buildman_and_testpy_dfn
319
Michal Simekf7c6ee72020-02-13 15:03:29 +0100320xilinx_zynq_virt test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400321 variables:
Michal Simekf7c6ee72020-02-13 15:03:29 +0100322 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rini1a62a722019-06-19 09:25:17 -0400323 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400324 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400325 <<: *buildman_and_testpy_dfn
326
327xilinx_versal_virt test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400328 variables:
329 TEST_PY_BD: "xilinx_versal_virt"
330 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400331 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400332 <<: *buildman_and_testpy_dfn
333
334xtfpga test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400335 variables:
336 TEST_PY_BD: "xtfpga"
337 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400338 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400339 <<: *buildman_and_testpy_dfn