blob: 2e77db777df8890fee6c97446d2b8d8c6b2ceb8c [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 Rini20bc19a2020-04-10 15:53:01 -04005image: trini/u-boot-gitlab-ci-runner:bionic-20200311-10Apr2020
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:
39 # From buildman, exit code 129 means warnings only. If we've been asked to
40 # use clang only do one configuration.
Simon Glass4e32fed2020-03-18 09:42:55 -060041 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
Simon Glass5bd95d62020-03-18 09:42:54 -060042 - ret=0;
Simon Glass4e32fed2020-03-18 09:42:55 -060043 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E
44 --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?;
Simon Glass5bd95d62020-03-18 09:42:54 -060045 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glass4e32fed2020-03-18 09:42:55 -060046 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -se
47 --board ${TEST_PY_BD};
Simon Glass5bd95d62020-03-18 09:42:54 -060048 exit $ret;
Tom Rini1a62a722019-06-19 09:25:17 -040049 fi
50 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
51 # never prevent any test from running. That way, we can always pass
52 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
53 # value.
Tom Rini085b8972019-10-24 11:59:27 -040054 - virtualenv -p /usr/bin/python3 /tmp/venv
55 - . /tmp/venv/bin/activate
56 - pip install -r test/py/requirements.txt
Simon Glass4e32fed2020-03-18 09:42:55 -060057 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rini1a62a722019-06-19 09:25:17 -040058 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Simon Glass5bd95d62020-03-18 09:42:54 -060059 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
60 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
61 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
62 ret=$?;
63 if [[ $ret -ne 0 ]]; then
64 exit $ret;
65 fi
Tom Rini1a62a722019-06-19 09:25:17 -040066
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020067build all 32bit ARM platforms:
Tom Rini1a62a722019-06-19 09:25:17 -040068 tags: [ 'all' ]
69 stage: world build
70 script:
71 - ret=0;
Tom Rini4c749972019-10-24 11:59:16 -040072 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
73 if [[ $ret -ne 0 && $ret -ne 129 ]]; 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 64bit ARM platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040079 tags: [ 'all' ]
80 stage: world build
81 script:
Tom Rini26a426a2020-02-11 12:41:14 -050082 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rinif0db8392019-07-18 07:28:36 -040083 - . /tmp/venv/bin/activate
84 - pip install pyelftools
Tom Rini9f7bda12019-07-17 17:51:28 -040085 - ret=0;
Tom Rini4c749972019-10-24 11:59:16 -040086 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
87 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060088 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -040089 exit $ret;
90 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -040091
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020092build all PowerPC platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040093 tags: [ 'all' ]
94 stage: world build
95 script:
96 - ret=0;
Tom Rini4c749972019-10-24 11:59:16 -040097 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
98 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -060099 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -0400100 exit $ret;
101 fi;
Tom Rini9f7bda12019-07-17 17:51:28 -0400102
Heinrich Schuchardta11cb572019-10-06 12:26:16 +0200103build all other platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -0400104 tags: [ 'all' ]
105 stage: world build
106 script:
107 - ret=0;
Tom Rini4c749972019-10-24 11:59:16 -0400108 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
109 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Simon Glassb52f5a12020-03-18 09:42:53 -0600110 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini4c749972019-10-24 11:59:16 -0400111 exit $ret;
112 fi;
Tom Rini1a62a722019-06-19 09:25:17 -0400113
114# QA jobs for code analytics
115# static code analysis with cppcheck (we can add --enable=all later)
116cppcheck:
117 tags: [ 'all' ]
118 stage: testsuites
119 script:
120 - cppcheck --force --quiet --inline-suppr .
121
122# search for TODO within source tree
123grep TODO/FIXME/HACK:
124 tags: [ 'all' ]
125 stage: testsuites
126 script:
127 - grep -r TODO .
128 - grep -r FIXME .
129 # search for HACK within source tree and ignore HACKKIT board
130 - grep -r HACK . | grep -v HACKKIT
131
Heinrich Schuchardt3eb7b782020-02-21 18:24:01 +0100132# build HTML documentation
133htmldocs:
134 tags: [ 'all' ]
135 stage: testsuites
136 script:
137 - make htmldocs
138
Tom Rini1a62a722019-06-19 09:25:17 -0400139# some statistics about the code base
140sloccount:
141 tags: [ 'all' ]
142 stage: testsuites
143 script:
144 - sloccount .
145
146# ensure all configs have MAINTAINERS entries
147Check for configs without MAINTAINERS entry:
148 tags: [ 'all' ]
149 stage: testsuites
150 script:
151 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
152
153# Ensure host tools build
154Build tools-only:
155 tags: [ 'all' ]
156 stage: testsuites
157 script:
158 - make tools-only_config tools-only -j$(nproc)
159
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200160# Ensure env tools build
161Build envtools:
162 tags: [ 'all' ]
163 stage: testsuites
164 script:
165 - make tools-only_config envtools -j$(nproc)
166
Tom Rini72618332020-03-11 18:11:15 -0400167Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rini1a62a722019-06-19 09:25:17 -0400168 tags: [ 'all' ]
169 stage: testsuites
170 script:
Tom Rinid7ae9322019-08-12 10:09:08 -0400171 - git config --global user.name "GitLab CI Runner";
172 git config --global user.email trini@konsulko.com;
173 export USER=gitlab;
Tom Rini26a426a2020-02-11 12:41:14 -0500174 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rinid7ae9322019-08-12 10:09:08 -0400175 . /tmp/venv/bin/activate;
Tom Rini72618332020-03-11 18:11:15 -0400176 pip install pyelftools pytest;
Simon Glassbf0a8132020-03-18 09:42:50 -0600177 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400178 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
179 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glassbf0a8132020-03-18 09:42:50 -0600180 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400181 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
182 ./tools/buildman/buildman -t;
183 ./tools/dtoc/dtoc -t;
Tom Rini72618332020-03-11 18:11:15 -0400184 ./tools/patman/patman --test;
185 make testconfig
Tom Rini1a62a722019-06-19 09:25:17 -0400186
187# Test sandbox with test.py
188sandbox test.py:
189 tags: [ 'all' ]
190 variables:
191 TEST_PY_BD: "sandbox"
Tom Rini1a62a722019-06-19 09:25:17 -0400192 <<: *buildman_and_testpy_dfn
193
Tom Rini0219d012019-11-06 19:30:47 -0500194sandbox with clang test.py:
195 tags: [ 'all' ]
196 variables:
197 TEST_PY_BD: "sandbox"
Tom Rini0219d012019-11-06 19:30:47 -0500198 OVERRIDE: "-O clang-7"
199 <<: *buildman_and_testpy_dfn
200
Tom Rini1a62a722019-06-19 09:25:17 -0400201sandbox_spl test.py:
202 tags: [ 'all' ]
203 variables:
204 TEST_PY_BD: "sandbox_spl"
Tom Rini1a62a722019-06-19 09:25:17 -0400205 TEST_PY_TEST_SPEC: "test_ofplatdata"
206 <<: *buildman_and_testpy_dfn
207
Tom Rini699c0b92019-07-17 16:06:57 -0400208evb-ast2500 test.py:
209 tags: [ 'all' ]
210 variables:
211 TEST_PY_BD: "evb-ast2500"
212 TEST_PY_ID: "--id qemu"
Tom Rini699c0b92019-07-17 16:06:57 -0400213 <<: *buildman_and_testpy_dfn
214
Tom Rini1a62a722019-06-19 09:25:17 -0400215sandbox_flattree test.py:
216 tags: [ 'all' ]
217 variables:
218 TEST_PY_BD: "sandbox_flattree"
Tom Rini1a62a722019-06-19 09:25:17 -0400219 <<: *buildman_and_testpy_dfn
220
221vexpress_ca15_tc2 test.py:
222 tags: [ 'all' ]
223 variables:
224 TEST_PY_BD: "vexpress_ca15_tc2"
225 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400226 <<: *buildman_and_testpy_dfn
227
228vexpress_ca9x4 test.py:
229 tags: [ 'all' ]
230 variables:
231 TEST_PY_BD: "vexpress_ca9x4"
232 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400233 <<: *buildman_and_testpy_dfn
234
235integratorcp_cm926ejs test.py:
236 tags: [ 'all' ]
237 variables:
238 TEST_PY_BD: "integratorcp_cm926ejs"
239 TEST_PY_TEST_SPEC: "not sleep"
240 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400241 <<: *buildman_and_testpy_dfn
242
243qemu_arm test.py:
244 tags: [ 'all' ]
245 variables:
246 TEST_PY_BD: "qemu_arm"
247 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400248 <<: *buildman_and_testpy_dfn
249
250qemu_arm64 test.py:
251 tags: [ 'all' ]
252 variables:
253 TEST_PY_BD: "qemu_arm64"
254 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400255 <<: *buildman_and_testpy_dfn
256
257qemu_mips test.py:
258 tags: [ 'all' ]
259 variables:
260 TEST_PY_BD: "qemu_mips"
261 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400262 <<: *buildman_and_testpy_dfn
263
264qemu_mipsel test.py:
265 tags: [ 'all' ]
266 variables:
267 TEST_PY_BD: "qemu_mipsel"
268 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400269 <<: *buildman_and_testpy_dfn
270
271qemu_mips64 test.py:
272 tags: [ 'all' ]
273 variables:
274 TEST_PY_BD: "qemu_mips64"
275 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400276 <<: *buildman_and_testpy_dfn
277
278qemu_mips64el test.py:
279 tags: [ 'all' ]
280 variables:
281 TEST_PY_BD: "qemu_mips64el"
282 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400283 <<: *buildman_and_testpy_dfn
284
285qemu-ppce500 test.py:
286 tags: [ 'all' ]
287 variables:
288 TEST_PY_BD: "qemu-ppce500"
289 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400290 <<: *buildman_and_testpy_dfn
291
Bin Menga379d332020-03-28 07:25:27 -0700292qemu-riscv32 test.py:
293 tags: [ 'all' ]
294 variables:
295 TEST_PY_BD: "qemu-riscv32"
296 TEST_PY_TEST_SPEC: "not sleep"
Bin Menga379d332020-03-28 07:25:27 -0700297 <<: *buildman_and_testpy_dfn
298
Tom Rini7298d822019-08-02 11:32:37 -0400299qemu-riscv64 test.py:
300 tags: [ 'all' ]
301 variables:
302 TEST_PY_BD: "qemu-riscv64"
303 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini7298d822019-08-02 11:32:37 -0400304 <<: *buildman_and_testpy_dfn
305
Bin Meng49fb28a2020-03-28 07:25:29 -0700306qemu-riscv32_spl test.py:
307 tags: [ 'all' ]
308 variables:
309 TEST_PY_BD: "qemu-riscv32_spl"
310 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700311 <<: *buildman_and_testpy_dfn
312
313qemu-riscv64_spl test.py:
314 tags: [ 'all' ]
315 variables:
316 TEST_PY_BD: "qemu-riscv64_spl"
317 TEST_PY_TEST_SPEC: "not sleep"
Bin Meng49fb28a2020-03-28 07:25:29 -0700318 <<: *buildman_and_testpy_dfn
319
Tom Rini1a62a722019-06-19 09:25:17 -0400320qemu-x86 test.py:
321 tags: [ 'all' ]
322 variables:
323 TEST_PY_BD: "qemu-x86"
324 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400325 <<: *buildman_and_testpy_dfn
326
327qemu-x86_64 test.py:
328 tags: [ 'all' ]
329 variables:
330 TEST_PY_BD: "qemu-x86_64"
331 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400332 <<: *buildman_and_testpy_dfn
333
Michal Simekf7c6ee72020-02-13 15:03:29 +0100334xilinx_zynq_virt test.py:
Tom Rini1a62a722019-06-19 09:25:17 -0400335 tags: [ 'all' ]
336 variables:
Michal Simekf7c6ee72020-02-13 15:03:29 +0100337 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rini1a62a722019-06-19 09:25:17 -0400338 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400339 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400340 <<: *buildman_and_testpy_dfn
341
342xilinx_versal_virt test.py:
343 tags: [ 'all' ]
344 variables:
345 TEST_PY_BD: "xilinx_versal_virt"
346 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400347 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400348 <<: *buildman_and_testpy_dfn
349
350xtfpga test.py:
351 tags: [ 'all' ]
352 variables:
353 TEST_PY_BD: "xtfpga"
354 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400355 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400356 <<: *buildman_and_testpy_dfn