blob: ffdeaae5a8843fa13830a0eec7e81e544d104d0e [file] [log] [blame]
Tom Rinid2244b92019-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 Schuchardt28b2b852021-02-24 13:19:04 +01004# https://source.denx.de/u-boot/gitlab-ci-runner
Tom Rinid776e8f2021-07-15 14:24:25 -04005image: trini/u-boot-gitlab-ci-runner:focal-20210723-04Aug2021
Tom Rinid2244b92019-06-19 09:25:17 -04006
7# We run some tests in different order, to catch some failures quicker.
8stages:
Tom Rinid2244b92019-06-19 09:25:17 -04009 - testsuites
Tom Rini1cdb1822019-07-24 13:09:31 -040010 - test.py
Tom Rinid2244b92019-06-19 09:25:17 -040011 - world build
12
13.buildman_and_testpy_template: &buildman_and_testpy_dfn
Tom Rinid2244b92019-06-19 09:25:17 -040014 stage: test.py
15 before_script:
16 # Clone uboot-test-hooks
Tom Rini2a1df582021-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 Rinid2244b92019-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 Rini6ad26042019-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 Mengb68d9d62020-03-28 07:25:29 -070022 - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
Heinrich Schuchardtac1b4002021-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 Mengb68d9d62020-03-28 07:25:29 -070025 fi
26 - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
Heinrich Schuchardtac1b4002021-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 Mengb68d9d62020-03-28 07:25:29 -070029 fi
Tom Rini1cdb1822019-07-24 13:09:31 -040030
Tom Rinid2244b92019-06-19 09:25:17 -040031 after_script:
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010032 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rinid2244b92019-06-19 09:25:17 -040033 script:
Simon Glassda499352020-03-18 09:42:57 -060034 # If we've been asked to use clang only do one configuration.
Simon Glass28d83e72020-03-18 09:42:55 -060035 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
Simon Glass87c80462020-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 Schuchardtba0ae212020-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 Schuchardtba0ae212020-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 Riniebcd2142019-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 Glass2600f7e2020-03-18 09:42:56 -060046 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
Simon Glass28d83e72020-03-18 09:42:55 -060047 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rinid2244b92019-06-19 09:25:17 -040048 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Heinrich Schuchardt2a3ec0a2020-07-10 22:04:40 +020049 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
Simon Glass2600f7e2020-03-18 09:42:56 -060050 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
Simon Glassfd0c59b2020-03-18 09:42:59 -060051 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
Tom Rinid2244b92019-06-19 09:25:17 -040052
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020053build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040054 stage: world build
55 script:
56 - ret=0;
Simon Glassda499352020-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 Glassad8eaed2020-03-18 09:42:53 -060059 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040060 exit $ret;
61 fi;
Tom Rini372c6972019-07-17 17:51:28 -040062
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020063build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040064 stage: world build
65 script:
Tom Rini6c883102020-02-11 12:41:14 -050066 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rini7faea832019-07-18 07:28:36 -040067 - . /tmp/venv/bin/activate
68 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040069 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060070 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
71 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060072 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040073 exit $ret;
74 fi;
Tom Rini372c6972019-07-17 17:51:28 -040075
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020076build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040077 stage: world build
78 script:
79 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060080 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
81 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060082 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040083 exit $ret;
84 fi;
Tom Rini372c6972019-07-17 17:51:28 -040085
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020086build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -040087 stage: world build
88 script:
89 - ret=0;
Simon Glassda499352020-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 Glassad8eaed2020-03-18 09:42:53 -060092 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040093 exit $ret;
94 fi;
Tom Rinid2244b92019-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 Rinid2244b92019-06-19 09:25:17 -040099 stage: testsuites
100 script:
Simon Glasscd1ccfa2020-04-05 14:35:43 -0600101 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
Tom Rinid2244b92019-06-19 09:25:17 -0400102
103# search for TODO within source tree
104grep TODO/FIXME/HACK:
Tom Rinid2244b92019-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 Schuchardtbccdb652020-02-21 18:24:01 +0100112# build HTML documentation
113htmldocs:
Heinrich Schuchardtbccdb652020-02-21 18:24:01 +0100114 stage: testsuites
115 script:
Heinrich Schuchardt846abe42021-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 Schuchardtbccdb652020-02-21 18:24:01 +0100119 - make htmldocs
120
Tom Rinid2244b92019-06-19 09:25:17 -0400121# some statistics about the code base
122sloccount:
Tom Rinid2244b92019-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 Rinid2244b92019-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 Rinid2244b92019-06-19 09:25:17 -0400135 stage: testsuites
136 script:
137 - make tools-only_config tools-only -j$(nproc)
138
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200139# Ensure env tools build
140Build envtools:
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200141 stage: testsuites
142 script:
143 - make tools-only_config envtools -j$(nproc)
144
Tom Rini0b3e0c42020-03-11 18:11:15 -0400145Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400146 stage: testsuites
147 script:
Tom Rini0b6e1032019-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 Rini6c883102020-02-11 12:41:14 -0500151 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rini0b6e1032019-08-12 10:09:08 -0400152 . /tmp/venv/bin/activate;
Tom Rini70c66dd2021-02-26 07:52:29 -0500153 pip install -r test/py/requirements.txt;
Simon Glass9e589c02020-03-18 09:42:50 -0600154 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rini0b6e1032019-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 Glass492f0b02021-03-15 17:25:34 +1300157 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
158 --board sandbox_spl;
Tom Rini0b6e1032019-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 Glass109e84e2020-07-05 21:41:55 -0600162 ./tools/patman/patman test;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400163 make testconfig
Tom Rinid2244b92019-06-19 09:25:17 -0400164
Pali Rohár80ad67b2020-05-17 14:38:22 +0200165Run tests for Nokia RX-51 (aka N900):
Pali Rohár80ad67b2020-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 Rinid2244b92019-06-19 09:25:17 -0400172# Test sandbox with test.py
173sandbox test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400174 variables:
175 TEST_PY_BD: "sandbox"
Tom Rinid2244b92019-06-19 09:25:17 -0400176 <<: *buildman_and_testpy_dfn
177
Tom Rini99a1bb32019-11-06 19:30:47 -0500178sandbox with clang test.py:
Tom Rini99a1bb32019-11-06 19:30:47 -0500179 variables:
180 TEST_PY_BD: "sandbox"
Tom Rinid776e8f2021-07-15 14:24:25 -0400181 OVERRIDE: "-O clang-12"
Tom Rini99a1bb32019-11-06 19:30:47 -0500182 <<: *buildman_and_testpy_dfn
183
Tom Rinid2244b92019-06-19 09:25:17 -0400184sandbox_spl test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400185 variables:
186 TEST_PY_BD: "sandbox_spl"
Simon Glass36a69e12020-10-25 20:38:36 -0600187 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
Tom Rinid2244b92019-06-19 09:25:17 -0400188 <<: *buildman_and_testpy_dfn
189
Simon Glass492f0b02021-03-15 17:25:34 +1300190sandbox_noinst_test.py:
Simon Glass492f0b02021-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 Rini0008b882019-07-17 16:06:57 -0400196evb-ast2500 test.py:
Tom Rini0008b882019-07-17 16:06:57 -0400197 variables:
198 TEST_PY_BD: "evb-ast2500"
199 TEST_PY_ID: "--id qemu"
Tom Rini0008b882019-07-17 16:06:57 -0400200 <<: *buildman_and_testpy_dfn
201
Tom Rinid2244b92019-06-19 09:25:17 -0400202sandbox_flattree test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400203 variables:
204 TEST_PY_BD: "sandbox_flattree"
Tom Rinid2244b92019-06-19 09:25:17 -0400205 <<: *buildman_and_testpy_dfn
206
Tom Rinid2244b92019-06-19 09:25:17 -0400207integratorcp_cm926ejs test.py:
Tom Rinid2244b92019-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 Rinid2244b92019-06-19 09:25:17 -0400212 <<: *buildman_and_testpy_dfn
213
214qemu_arm test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400215 variables:
216 TEST_PY_BD: "qemu_arm"
217 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400218 <<: *buildman_and_testpy_dfn
219
220qemu_arm64 test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400221 variables:
222 TEST_PY_BD: "qemu_arm64"
223 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400224 <<: *buildman_and_testpy_dfn
225
Daniel Schwierzeck744af392020-06-06 22:21:47 +0200226qemu_malta test.py:
Daniel Schwierzeck744af392020-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 Schwierzeck744af392020-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 Schwierzeck744af392020-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 Schwierzeck744af392020-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 Rinid2244b92019-06-19 09:25:17 -0400254qemu-ppce500 test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400255 variables:
256 TEST_PY_BD: "qemu-ppce500"
257 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400258 <<: *buildman_and_testpy_dfn
259
Bin Mengaeb3ea42020-03-28 07:25:27 -0700260qemu-riscv32 test.py:
Bin Mengaeb3ea42020-03-28 07:25:27 -0700261 variables:
262 TEST_PY_BD: "qemu-riscv32"
263 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengaeb3ea42020-03-28 07:25:27 -0700264 <<: *buildman_and_testpy_dfn
265
Tom Rinic8c320e2019-08-02 11:32:37 -0400266qemu-riscv64 test.py:
Tom Rinic8c320e2019-08-02 11:32:37 -0400267 variables:
268 TEST_PY_BD: "qemu-riscv64"
269 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinic8c320e2019-08-02 11:32:37 -0400270 <<: *buildman_and_testpy_dfn
271
Bin Mengb68d9d62020-03-28 07:25:29 -0700272qemu-riscv32_spl test.py:
Bin Mengb68d9d62020-03-28 07:25:29 -0700273 variables:
274 TEST_PY_BD: "qemu-riscv32_spl"
275 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700276 <<: *buildman_and_testpy_dfn
277
278qemu-riscv64_spl test.py:
Bin Mengb68d9d62020-03-28 07:25:29 -0700279 variables:
280 TEST_PY_BD: "qemu-riscv64_spl"
281 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700282 <<: *buildman_and_testpy_dfn
283
Tom Rinid2244b92019-06-19 09:25:17 -0400284qemu-x86 test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400285 variables:
286 TEST_PY_BD: "qemu-x86"
287 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400288 <<: *buildman_and_testpy_dfn
289
290qemu-x86_64 test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400291 variables:
292 TEST_PY_BD: "qemu-x86_64"
293 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400294 <<: *buildman_and_testpy_dfn
295
Marek Vasutfc5a9d72020-09-14 21:55:58 +0200296r2dplus_i82557c test.py:
Marek Vasutfc5a9d72020-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 Vasutfc5a9d72020-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 Vasutfc5a9d72020-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 Vasutfc5a9d72020-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 Simekf8834fd2020-02-13 15:03:29 +0100320xilinx_zynq_virt test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400321 variables:
Michal Simekf8834fd2020-02-13 15:03:29 +0100322 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rinid2244b92019-06-19 09:25:17 -0400323 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400324 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400325 <<: *buildman_and_testpy_dfn
326
327xilinx_versal_virt test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400328 variables:
329 TEST_PY_BD: "xilinx_versal_virt"
330 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400331 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400332 <<: *buildman_and_testpy_dfn
333
334xtfpga test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400335 variables:
336 TEST_PY_BD: "xtfpga"
337 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400338 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400339 <<: *buildman_and_testpy_dfn