blob: bf207db09e02cc1869b6057503a39b32d17966f5 [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:
4# https://gitlab.denx.de/u-boot/gitlab-ci-runner
Tom Rini3c396bc2020-04-10 15:53:01 -04005image: trini/u-boot-gitlab-ci-runner:bionic-20200311-10Apr2020
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
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 Rini6ad26042019-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 Schuchardt159b0ab2019-12-19 13:30:32 +010023 - cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
Bin Mengaeb3ea42020-03-28 07:25:27 -070024 - cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010025 - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
26 - cp /opt/grub/grubarm.efi ~/grub_arm.efi
Bin Mengb68d9d62020-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 Rini1cdb1822019-07-24 13:09:31 -040035
Tom Rinid2244b92019-06-19 09:25:17 -040036 after_script:
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010037 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rinid2244b92019-06-19 09:25:17 -040038 script:
39 # From buildman, exit code 129 means warnings only. If we've been asked to
40 # use clang only do one configuration.
Simon Glass28d83e72020-03-18 09:42:55 -060041 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
Simon Glass3b16d072020-03-18 09:42:54 -060042 - ret=0;
Simon Glass28d83e72020-03-18 09:42:55 -060043 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E
44 --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?;
Simon Glass3b16d072020-03-18 09:42:54 -060045 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glass28d83e72020-03-18 09:42:55 -060046 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -se
47 --board ${TEST_PY_BD};
Simon Glass3b16d072020-03-18 09:42:54 -060048 exit $ret;
Tom Rinid2244b92019-06-19 09:25:17 -040049 fi
Tom Riniebcd2142019-10-24 11:59:27 -040050 - virtualenv -p /usr/bin/python3 /tmp/venv
51 - . /tmp/venv/bin/activate
52 - pip install -r test/py/requirements.txt
Simon Glass2600f7e2020-03-18 09:42:56 -060053 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
Simon Glass28d83e72020-03-18 09:42:55 -060054 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rinid2244b92019-06-19 09:25:17 -040055 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Simon Glass3b16d072020-03-18 09:42:54 -060056 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
Simon Glass2600f7e2020-03-18 09:42:56 -060057 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
Simon Glass3b16d072020-03-18 09:42:54 -060058 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
59 ret=$?;
60 if [[ $ret -ne 0 ]]; then
61 exit $ret;
62 fi
Tom Rinid2244b92019-06-19 09:25:17 -040063
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020064build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040065 tags: [ 'all' ]
66 stage: world build
67 script:
68 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040069 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
70 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060071 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040072 exit $ret;
73 fi;
Tom Rini372c6972019-07-17 17:51:28 -040074
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020075build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040076 tags: [ 'all' ]
77 stage: world build
78 script:
Tom Rini6c883102020-02-11 12:41:14 -050079 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rini7faea832019-07-18 07:28:36 -040080 - . /tmp/venv/bin/activate
81 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040082 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040083 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
84 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060085 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040086 exit $ret;
87 fi;
Tom Rini372c6972019-07-17 17:51:28 -040088
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020089build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040090 tags: [ 'all' ]
91 stage: world build
92 script:
93 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040094 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
95 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060096 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040097 exit $ret;
98 fi;
Tom Rini372c6972019-07-17 17:51:28 -040099
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +0200100build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -0400101 tags: [ 'all' ]
102 stage: world build
103 script:
104 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -0400105 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
106 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -0600107 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -0400108 exit $ret;
109 fi;
Tom Rinid2244b92019-06-19 09:25:17 -0400110
111# QA jobs for code analytics
112# static code analysis with cppcheck (we can add --enable=all later)
113cppcheck:
114 tags: [ 'all' ]
115 stage: testsuites
116 script:
117 - cppcheck --force --quiet --inline-suppr .
118
119# search for TODO within source tree
120grep TODO/FIXME/HACK:
121 tags: [ 'all' ]
122 stage: testsuites
123 script:
124 - grep -r TODO .
125 - grep -r FIXME .
126 # search for HACK within source tree and ignore HACKKIT board
127 - grep -r HACK . | grep -v HACKKIT
128
Heinrich Schuchardtbccdb652020-02-21 18:24:01 +0100129# build HTML documentation
130htmldocs:
131 tags: [ 'all' ]
132 stage: testsuites
133 script:
134 - make htmldocs
135
Tom Rinid2244b92019-06-19 09:25:17 -0400136# some statistics about the code base
137sloccount:
138 tags: [ 'all' ]
139 stage: testsuites
140 script:
141 - sloccount .
142
143# ensure all configs have MAINTAINERS entries
144Check for configs without MAINTAINERS entry:
145 tags: [ 'all' ]
146 stage: testsuites
147 script:
148 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
149
150# Ensure host tools build
151Build tools-only:
152 tags: [ 'all' ]
153 stage: testsuites
154 script:
155 - make tools-only_config tools-only -j$(nproc)
156
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200157# Ensure env tools build
158Build envtools:
159 tags: [ 'all' ]
160 stage: testsuites
161 script:
162 - make tools-only_config envtools -j$(nproc)
163
Tom Rini0b3e0c42020-03-11 18:11:15 -0400164Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400165 tags: [ 'all' ]
166 stage: testsuites
167 script:
Tom Rini0b6e1032019-08-12 10:09:08 -0400168 - git config --global user.name "GitLab CI Runner";
169 git config --global user.email trini@konsulko.com;
170 export USER=gitlab;
Tom Rini6c883102020-02-11 12:41:14 -0500171 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rini0b6e1032019-08-12 10:09:08 -0400172 . /tmp/venv/bin/activate;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400173 pip install pyelftools pytest;
Simon Glass9e589c02020-03-18 09:42:50 -0600174 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400175 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
176 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass9e589c02020-03-18 09:42:50 -0600177 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400178 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
179 ./tools/buildman/buildman -t;
180 ./tools/dtoc/dtoc -t;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400181 ./tools/patman/patman --test;
182 make testconfig
Tom Rinid2244b92019-06-19 09:25:17 -0400183
184# Test sandbox with test.py
185sandbox test.py:
186 tags: [ 'all' ]
187 variables:
188 TEST_PY_BD: "sandbox"
Tom Rinid2244b92019-06-19 09:25:17 -0400189 <<: *buildman_and_testpy_dfn
190
Tom Rini99a1bb32019-11-06 19:30:47 -0500191sandbox with clang test.py:
192 tags: [ 'all' ]
193 variables:
194 TEST_PY_BD: "sandbox"
Tom Rini99a1bb32019-11-06 19:30:47 -0500195 OVERRIDE: "-O clang-7"
196 <<: *buildman_and_testpy_dfn
197
Tom Rinid2244b92019-06-19 09:25:17 -0400198sandbox_spl test.py:
199 tags: [ 'all' ]
200 variables:
201 TEST_PY_BD: "sandbox_spl"
Tom Rinid2244b92019-06-19 09:25:17 -0400202 TEST_PY_TEST_SPEC: "test_ofplatdata"
203 <<: *buildman_and_testpy_dfn
204
Tom Rini0008b882019-07-17 16:06:57 -0400205evb-ast2500 test.py:
206 tags: [ 'all' ]
207 variables:
208 TEST_PY_BD: "evb-ast2500"
209 TEST_PY_ID: "--id qemu"
Tom Rini0008b882019-07-17 16:06:57 -0400210 <<: *buildman_and_testpy_dfn
211
Tom Rinid2244b92019-06-19 09:25:17 -0400212sandbox_flattree test.py:
213 tags: [ 'all' ]
214 variables:
215 TEST_PY_BD: "sandbox_flattree"
Tom Rinid2244b92019-06-19 09:25:17 -0400216 <<: *buildman_and_testpy_dfn
217
218vexpress_ca15_tc2 test.py:
219 tags: [ 'all' ]
220 variables:
221 TEST_PY_BD: "vexpress_ca15_tc2"
222 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400223 <<: *buildman_and_testpy_dfn
224
225vexpress_ca9x4 test.py:
226 tags: [ 'all' ]
227 variables:
228 TEST_PY_BD: "vexpress_ca9x4"
229 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400230 <<: *buildman_and_testpy_dfn
231
232integratorcp_cm926ejs test.py:
233 tags: [ 'all' ]
234 variables:
235 TEST_PY_BD: "integratorcp_cm926ejs"
236 TEST_PY_TEST_SPEC: "not sleep"
237 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400238 <<: *buildman_and_testpy_dfn
239
240qemu_arm test.py:
241 tags: [ 'all' ]
242 variables:
243 TEST_PY_BD: "qemu_arm"
244 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400245 <<: *buildman_and_testpy_dfn
246
247qemu_arm64 test.py:
248 tags: [ 'all' ]
249 variables:
250 TEST_PY_BD: "qemu_arm64"
251 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400252 <<: *buildman_and_testpy_dfn
253
254qemu_mips test.py:
255 tags: [ 'all' ]
256 variables:
257 TEST_PY_BD: "qemu_mips"
258 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400259 <<: *buildman_and_testpy_dfn
260
261qemu_mipsel test.py:
262 tags: [ 'all' ]
263 variables:
264 TEST_PY_BD: "qemu_mipsel"
265 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400266 <<: *buildman_and_testpy_dfn
267
268qemu_mips64 test.py:
269 tags: [ 'all' ]
270 variables:
271 TEST_PY_BD: "qemu_mips64"
272 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400273 <<: *buildman_and_testpy_dfn
274
275qemu_mips64el test.py:
276 tags: [ 'all' ]
277 variables:
278 TEST_PY_BD: "qemu_mips64el"
279 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400280 <<: *buildman_and_testpy_dfn
281
282qemu-ppce500 test.py:
283 tags: [ 'all' ]
284 variables:
285 TEST_PY_BD: "qemu-ppce500"
286 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400287 <<: *buildman_and_testpy_dfn
288
Bin Mengaeb3ea42020-03-28 07:25:27 -0700289qemu-riscv32 test.py:
290 tags: [ 'all' ]
291 variables:
292 TEST_PY_BD: "qemu-riscv32"
293 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengaeb3ea42020-03-28 07:25:27 -0700294 <<: *buildman_and_testpy_dfn
295
Tom Rinic8c320e2019-08-02 11:32:37 -0400296qemu-riscv64 test.py:
297 tags: [ 'all' ]
298 variables:
299 TEST_PY_BD: "qemu-riscv64"
300 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinic8c320e2019-08-02 11:32:37 -0400301 <<: *buildman_and_testpy_dfn
302
Bin Mengb68d9d62020-03-28 07:25:29 -0700303qemu-riscv32_spl test.py:
304 tags: [ 'all' ]
305 variables:
306 TEST_PY_BD: "qemu-riscv32_spl"
307 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700308 <<: *buildman_and_testpy_dfn
309
310qemu-riscv64_spl test.py:
311 tags: [ 'all' ]
312 variables:
313 TEST_PY_BD: "qemu-riscv64_spl"
314 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700315 <<: *buildman_and_testpy_dfn
316
Tom Rinid2244b92019-06-19 09:25:17 -0400317qemu-x86 test.py:
318 tags: [ 'all' ]
319 variables:
320 TEST_PY_BD: "qemu-x86"
321 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400322 <<: *buildman_and_testpy_dfn
323
324qemu-x86_64 test.py:
325 tags: [ 'all' ]
326 variables:
327 TEST_PY_BD: "qemu-x86_64"
328 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400329 <<: *buildman_and_testpy_dfn
330
Michal Simekf8834fd2020-02-13 15:03:29 +0100331xilinx_zynq_virt test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400332 tags: [ 'all' ]
333 variables:
Michal Simekf8834fd2020-02-13 15:03:29 +0100334 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rinid2244b92019-06-19 09:25:17 -0400335 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400336 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400337 <<: *buildman_and_testpy_dfn
338
339xilinx_versal_virt test.py:
340 tags: [ 'all' ]
341 variables:
342 TEST_PY_BD: "xilinx_versal_virt"
343 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400344 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400345 <<: *buildman_and_testpy_dfn
346
347xtfpga test.py:
348 tags: [ 'all' ]
349 variables:
350 TEST_PY_BD: "xtfpga"
351 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400352 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400353 <<: *buildman_and_testpy_dfn