blob: f43b3c26ef81380246ddd9cf4864d076d4d37dce [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 Rinid6b58312020-02-24 11:04:29 -05005image: trini/u-boot-gitlab-ci-runner:bionic-20200112-21Feb2020
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
24 - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
25 - cp /opt/grub/grubarm.efi ~/grub_arm.efi
Tom Rini1cdb1822019-07-24 13:09:31 -040026
Tom Rinid2244b92019-06-19 09:25:17 -040027 after_script:
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010028 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rinid2244b92019-06-19 09:25:17 -040029 script:
30 # From buildman, exit code 129 means warnings only. If we've been asked to
31 # use clang only do one configuration.
32 - if [[ "${BUILDMAN}" != "" ]]; then
33 ret=0;
Simon Glass070811f2020-02-11 17:15:19 -070034 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
Tom Rinid2244b92019-06-19 09:25:17 -040035 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rini254b98e2019-10-04 12:12:53 -040036 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
Tom Rinid2244b92019-06-19 09:25:17 -040037 exit $ret;
38 fi;
39 fi
40 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
41 # never prevent any test from running. That way, we can always pass
42 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
43 # value.
Tom Riniebcd2142019-10-24 11:59:27 -040044 - virtualenv -p /usr/bin/python3 /tmp/venv
45 - . /tmp/venv/bin/activate
46 - pip install -r test/py/requirements.txt
Tom Rini254b98e2019-10-04 12:12:53 -040047 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
Tom Rini3fcb3f52019-10-24 11:59:17 -040048 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rinid2244b92019-06-19 09:25:17 -040049 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
50 if [[ "${TEST_PY_BD}" != "" ]]; then
51 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
52 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
53 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
54 ret=$?;
55 if [[ $ret -ne 0 ]]; then
56 exit $ret;
57 fi;
58 fi;
59
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020060build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040061 tags: [ 'all' ]
62 stage: world build
63 script:
64 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040065 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
66 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
67 ./tools/buildman/buildman -o /tmp -sdeP;
68 exit $ret;
69 fi;
Tom Rini372c6972019-07-17 17:51:28 -040070
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020071build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040072 tags: [ 'all' ]
73 stage: world build
74 script:
Tom Rini6c883102020-02-11 12:41:14 -050075 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rini7faea832019-07-18 07:28:36 -040076 - . /tmp/venv/bin/activate
77 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040078 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040079 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
80 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
81 ./tools/buildman/buildman -o /tmp -sdeP;
82 exit $ret;
83 fi;
Tom Rini372c6972019-07-17 17:51:28 -040084
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020085build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040086 tags: [ 'all' ]
87 stage: world build
88 script:
89 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040090 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
91 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
92 ./tools/buildman/buildman -o /tmp -sdeP;
93 exit $ret;
94 fi;
Tom Rini372c6972019-07-17 17:51:28 -040095
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020096build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -040097 tags: [ 'all' ]
98 stage: world build
99 script:
100 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -0400101 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
102 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
103 ./tools/buildman/buildman -o /tmp -sdeP;
104 exit $ret;
105 fi;
Tom Rinid2244b92019-06-19 09:25:17 -0400106
107# QA jobs for code analytics
108# static code analysis with cppcheck (we can add --enable=all later)
109cppcheck:
110 tags: [ 'all' ]
111 stage: testsuites
112 script:
113 - cppcheck --force --quiet --inline-suppr .
114
115# search for TODO within source tree
116grep TODO/FIXME/HACK:
117 tags: [ 'all' ]
118 stage: testsuites
119 script:
120 - grep -r TODO .
121 - grep -r FIXME .
122 # search for HACK within source tree and ignore HACKKIT board
123 - grep -r HACK . | grep -v HACKKIT
124
Heinrich Schuchardtbccdb652020-02-21 18:24:01 +0100125# build HTML documentation
126htmldocs:
127 tags: [ 'all' ]
128 stage: testsuites
129 script:
130 - make htmldocs
131
Tom Rinid2244b92019-06-19 09:25:17 -0400132# some statistics about the code base
133sloccount:
134 tags: [ 'all' ]
135 stage: testsuites
136 script:
137 - sloccount .
138
139# ensure all configs have MAINTAINERS entries
140Check for configs without MAINTAINERS entry:
141 tags: [ 'all' ]
142 stage: testsuites
143 script:
144 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
145
146# Ensure host tools build
147Build tools-only:
148 tags: [ 'all' ]
149 stage: testsuites
150 script:
151 - make tools-only_config tools-only -j$(nproc)
152
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200153# Ensure env tools build
154Build envtools:
155 tags: [ 'all' ]
156 stage: testsuites
157 script:
158 - make tools-only_config envtools -j$(nproc)
159
Tom Rini0b3e0c42020-03-11 18:11:15 -0400160Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400161 tags: [ 'all' ]
162 stage: testsuites
163 script:
Tom Rini0b6e1032019-08-12 10:09:08 -0400164 - git config --global user.name "GitLab CI Runner";
165 git config --global user.email trini@konsulko.com;
166 export USER=gitlab;
Tom Rini6c883102020-02-11 12:41:14 -0500167 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rini0b6e1032019-08-12 10:09:08 -0400168 . /tmp/venv/bin/activate;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400169 pip install pyelftools pytest;
Tom Rini254b98e2019-10-04 12:12:53 -0400170 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400171 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
172 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass070811f2020-02-11 17:15:19 -0700173 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400174 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
175 ./tools/buildman/buildman -t;
176 ./tools/dtoc/dtoc -t;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400177 ./tools/patman/patman --test;
178 make testconfig
Tom Rinid2244b92019-06-19 09:25:17 -0400179
180# Test sandbox with test.py
181sandbox test.py:
182 tags: [ 'all' ]
183 variables:
184 TEST_PY_BD: "sandbox"
185 BUILDMAN: "^sandbox$"
186 <<: *buildman_and_testpy_dfn
187
Tom Rini99a1bb32019-11-06 19:30:47 -0500188sandbox with clang test.py:
189 tags: [ 'all' ]
190 variables:
191 TEST_PY_BD: "sandbox"
192 BUILDMAN: "^sandbox$"
193 OVERRIDE: "-O clang-7"
194 <<: *buildman_and_testpy_dfn
195
Tom Rinid2244b92019-06-19 09:25:17 -0400196sandbox_spl test.py:
197 tags: [ 'all' ]
198 variables:
199 TEST_PY_BD: "sandbox_spl"
200 BUILDMAN: "^sandbox_spl$"
201 TEST_PY_TEST_SPEC: "test_ofplatdata"
202 <<: *buildman_and_testpy_dfn
203
Tom Rini0008b882019-07-17 16:06:57 -0400204evb-ast2500 test.py:
205 tags: [ 'all' ]
206 variables:
207 TEST_PY_BD: "evb-ast2500"
208 TEST_PY_ID: "--id qemu"
Tom Rini0008b882019-07-17 16:06:57 -0400209 BUILDMAN: "^evb-ast2500$"
210 <<: *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"
216 BUILDMAN: "^sandbox_flattree$"
217 <<: *buildman_and_testpy_dfn
218
219vexpress_ca15_tc2 test.py:
220 tags: [ 'all' ]
221 variables:
222 TEST_PY_BD: "vexpress_ca15_tc2"
223 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400224 BUILDMAN: "^vexpress_ca15_tc2$"
225 <<: *buildman_and_testpy_dfn
226
227vexpress_ca9x4 test.py:
228 tags: [ 'all' ]
229 variables:
230 TEST_PY_BD: "vexpress_ca9x4"
231 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400232 BUILDMAN: "^vexpress_ca9x4$"
233 <<: *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 Rinid2244b92019-06-19 09:25:17 -0400241 BUILDMAN: "^integratorcp_cm926ejs$"
242 <<: *buildman_and_testpy_dfn
243
244qemu_arm test.py:
245 tags: [ 'all' ]
246 variables:
247 TEST_PY_BD: "qemu_arm"
248 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400249 BUILDMAN: "^qemu_arm$"
250 <<: *buildman_and_testpy_dfn
251
252qemu_arm64 test.py:
253 tags: [ 'all' ]
254 variables:
255 TEST_PY_BD: "qemu_arm64"
256 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400257 BUILDMAN: "^qemu_arm64$"
258 <<: *buildman_and_testpy_dfn
259
260qemu_mips test.py:
261 tags: [ 'all' ]
262 variables:
263 TEST_PY_BD: "qemu_mips"
264 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400265 BUILDMAN: "^qemu_mips$"
Tom Rinid2244b92019-06-19 09:25:17 -0400266 <<: *buildman_and_testpy_dfn
267
268qemu_mipsel test.py:
269 tags: [ 'all' ]
270 variables:
271 TEST_PY_BD: "qemu_mipsel"
272 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400273 BUILDMAN: "^qemu_mipsel$"
Tom Rinid2244b92019-06-19 09:25:17 -0400274 <<: *buildman_and_testpy_dfn
275
276qemu_mips64 test.py:
277 tags: [ 'all' ]
278 variables:
279 TEST_PY_BD: "qemu_mips64"
280 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400281 BUILDMAN: "^qemu_mips64$"
Tom Rinid2244b92019-06-19 09:25:17 -0400282 <<: *buildman_and_testpy_dfn
283
284qemu_mips64el test.py:
285 tags: [ 'all' ]
286 variables:
287 TEST_PY_BD: "qemu_mips64el"
288 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400289 BUILDMAN: "^qemu_mips64el$"
Tom Rinid2244b92019-06-19 09:25:17 -0400290 <<: *buildman_and_testpy_dfn
291
292qemu-ppce500 test.py:
293 tags: [ 'all' ]
294 variables:
295 TEST_PY_BD: "qemu-ppce500"
296 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400297 BUILDMAN: "^qemu-ppce500$"
Tom Rinid2244b92019-06-19 09:25:17 -0400298 <<: *buildman_and_testpy_dfn
299
Tom Rinic8c320e2019-08-02 11:32:37 -0400300qemu-riscv64 test.py:
301 tags: [ 'all' ]
302 variables:
303 TEST_PY_BD: "qemu-riscv64"
304 TEST_PY_TEST_SPEC: "not sleep"
305 BUILDMAN: "^qemu-riscv64$"
306 <<: *buildman_and_testpy_dfn
307
Tom Rinid2244b92019-06-19 09:25:17 -0400308qemu-x86 test.py:
309 tags: [ 'all' ]
310 variables:
311 TEST_PY_BD: "qemu-x86"
312 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400313 BUILDMAN: "^qemu-x86$"
Tom Rinid2244b92019-06-19 09:25:17 -0400314 <<: *buildman_and_testpy_dfn
315
316qemu-x86_64 test.py:
317 tags: [ 'all' ]
318 variables:
319 TEST_PY_BD: "qemu-x86_64"
320 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400321 BUILDMAN: "^qemu-x86_64$"
Tom Rinid2244b92019-06-19 09:25:17 -0400322 <<: *buildman_and_testpy_dfn
323
324zynq_zc702 test.py:
325 tags: [ 'all' ]
326 variables:
327 TEST_PY_BD: "zynq_zc702"
328 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400329 TEST_PY_ID: "--id qemu"
330 BUILDMAN: "^zynq_zc702$"
331 <<: *buildman_and_testpy_dfn
332
333xilinx_versal_virt test.py:
334 tags: [ 'all' ]
335 variables:
336 TEST_PY_BD: "xilinx_versal_virt"
337 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400338 TEST_PY_ID: "--id qemu"
339 BUILDMAN: "^xilinx_versal_virt$"
340 <<: *buildman_and_testpy_dfn
341
342xtfpga test.py:
343 tags: [ 'all' ]
344 variables:
345 TEST_PY_BD: "xtfpga"
346 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400347 TEST_PY_ID: "--id qemu"
348 BUILDMAN: "^xtfpga$"
Tom Rinid2244b92019-06-19 09:25:17 -0400349 <<: *buildman_and_testpy_dfn