blob: a37e0e80665cce1a574275bd82d62fd5fdcc37f3 [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 Rini7298d822019-08-02 11:32:37 -04005image: trini/u-boot-gitlab-ci-runner:xenial-20190720-02Aug2019
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`
21 - virtualenv /tmp/venv
22 - . /tmp/venv/bin/activate
23 - pip install pytest==2.8.7
24 - pip install python-subunit
25 - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
26 - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
27 - mkdir ~/grub2-arm
28 - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di )
29 - mkdir ~/grub2-arm64
30 - ( cd ~/grub2-arm64; wget -O - http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm | rpm2cpio | cpio -di )
Tom Rinib29cb052019-07-24 13:09:31 -040031
Tom Rini1a62a722019-06-19 09:25:17 -040032 after_script:
Tom Rinib29cb052019-07-24 13:09:31 -040033 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
Tom Rini1a62a722019-06-19 09:25:17 -040034 script:
35 # From buildman, exit code 129 means warnings only. If we've been asked to
36 # use clang only do one configuration.
37 - if [[ "${BUILDMAN}" != "" ]]; then
38 ret=0;
Tom Rinidb7b8602019-10-04 12:12:53 -040039 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
Tom Rini1a62a722019-06-19 09:25:17 -040040 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rinidb7b8602019-10-04 12:12:53 -040041 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
Tom Rini1a62a722019-06-19 09:25:17 -040042 exit $ret;
43 fi;
44 fi
45 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
46 # never prevent any test from running. That way, we can always pass
47 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
48 # value.
Tom Rinidb7b8602019-10-04 12:12:53 -040049 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
Tom Rinib29cb052019-07-24 13:09:31 -040050 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
Tom Rini1a62a722019-06-19 09:25:17 -040051 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
52 if [[ "${TEST_PY_BD}" != "" ]]; then
53 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
54 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
55 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
56 ret=$?;
57 if [[ $ret -ne 0 ]]; then
58 exit $ret;
59 fi;
60 fi;
61
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020062build all 32bit ARM platforms:
Tom Rini1a62a722019-06-19 09:25:17 -040063 tags: [ 'all' ]
64 stage: world build
65 script:
66 - ret=0;
Tom Rinidb7b8602019-10-04 12:12:53 -040067 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
Tom Rini9f7bda12019-07-17 17:51:28 -040068 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rinidb7b8602019-10-04 12:12:53 -040069 ./tools/buildman/buildman -o /tmp -sdeP;
Tom Rini9f7bda12019-07-17 17:51:28 -040070 exit $ret;
71 fi;
72
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020073build all 64bit ARM platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040074 tags: [ 'all' ]
75 stage: world build
76 script:
Tom Rinif0db8392019-07-18 07:28:36 -040077 - virtualenv /tmp/venv
78 - . /tmp/venv/bin/activate
79 - pip install pyelftools
Tom Rini9f7bda12019-07-17 17:51:28 -040080 - ret=0;
Tom Rinidb7b8602019-10-04 12:12:53 -040081 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
Tom Rini9f7bda12019-07-17 17:51:28 -040082 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rinidb7b8602019-10-04 12:12:53 -040083 ./tools/buildman/buildman -o /tmp -sdeP;
Tom Rini9f7bda12019-07-17 17:51:28 -040084 exit $ret;
85 fi;
86
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020087build all PowerPC platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040088 tags: [ 'all' ]
89 stage: world build
90 script:
91 - ret=0;
Tom Rinidb7b8602019-10-04 12:12:53 -040092 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
Tom Rini9f7bda12019-07-17 17:51:28 -040093 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rinidb7b8602019-10-04 12:12:53 -040094 ./tools/buildman/buildman -o /tmp -sdeP;
Tom Rini9f7bda12019-07-17 17:51:28 -040095 exit $ret;
96 fi;
97
Heinrich Schuchardta11cb572019-10-06 12:26:16 +020098build all other platforms:
Tom Rini9f7bda12019-07-17 17:51:28 -040099 tags: [ 'all' ]
100 stage: world build
101 script:
102 - ret=0;
Tom Rinidb7b8602019-10-04 12:12:53 -0400103 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
Tom Rini1a62a722019-06-19 09:25:17 -0400104 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rinidb7b8602019-10-04 12:12:53 -0400105 ./tools/buildman/buildman -o /tmp -sdeP;
Tom Rini1a62a722019-06-19 09:25:17 -0400106 exit $ret;
107 fi;
108
109# QA jobs for code analytics
110# static code analysis with cppcheck (we can add --enable=all later)
111cppcheck:
112 tags: [ 'all' ]
113 stage: testsuites
114 script:
115 - cppcheck --force --quiet --inline-suppr .
116
117# search for TODO within source tree
118grep TODO/FIXME/HACK:
119 tags: [ 'all' ]
120 stage: testsuites
121 script:
122 - grep -r TODO .
123 - grep -r FIXME .
124 # search for HACK within source tree and ignore HACKKIT board
125 - grep -r HACK . | grep -v HACKKIT
126
127# some statistics about the code base
128sloccount:
129 tags: [ 'all' ]
130 stage: testsuites
131 script:
132 - sloccount .
133
134# ensure all configs have MAINTAINERS entries
135Check for configs without MAINTAINERS entry:
136 tags: [ 'all' ]
137 stage: testsuites
138 script:
139 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
140
141# Ensure host tools build
142Build tools-only:
143 tags: [ 'all' ]
144 stage: testsuites
145 script:
146 - make tools-only_config tools-only -j$(nproc)
147
Pierre-Jean Texier1f3910d2019-08-26 13:06:18 +0200148# Ensure env tools build
149Build envtools:
150 tags: [ 'all' ]
151 stage: testsuites
152 script:
153 - make tools-only_config envtools -j$(nproc)
154
Tom Rinid7ae9322019-08-12 10:09:08 -0400155Run binman, buildman, dtoc and patman testsuites:
Tom Rini1a62a722019-06-19 09:25:17 -0400156 tags: [ 'all' ]
157 stage: testsuites
158 script:
Tom Rinid7ae9322019-08-12 10:09:08 -0400159 - git config --global user.name "GitLab CI Runner";
160 git config --global user.email trini@konsulko.com;
161 export USER=gitlab;
162 virtualenv /tmp/venv;
163 . /tmp/venv/bin/activate;
164 pip install pyelftools;
Tom Rinidb7b8602019-10-04 12:12:53 -0400165 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400166 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
167 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Tom Rinidb7b8602019-10-04 12:12:53 -0400168 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
Tom Rinid7ae9322019-08-12 10:09:08 -0400169 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
170 ./tools/buildman/buildman -t;
171 ./tools/dtoc/dtoc -t;
172 ./tools/patman/patman --test
Tom Rini1a62a722019-06-19 09:25:17 -0400173
174# Test sandbox with test.py
175sandbox test.py:
176 tags: [ 'all' ]
177 variables:
178 TEST_PY_BD: "sandbox"
179 BUILDMAN: "^sandbox$"
180 <<: *buildman_and_testpy_dfn
181
182sandbox_spl test.py:
183 tags: [ 'all' ]
184 variables:
185 TEST_PY_BD: "sandbox_spl"
186 BUILDMAN: "^sandbox_spl$"
187 TEST_PY_TEST_SPEC: "test_ofplatdata"
188 <<: *buildman_and_testpy_dfn
189
Tom Rini699c0b92019-07-17 16:06:57 -0400190evb-ast2500 test.py:
191 tags: [ 'all' ]
192 variables:
193 TEST_PY_BD: "evb-ast2500"
194 TEST_PY_ID: "--id qemu"
Tom Rini699c0b92019-07-17 16:06:57 -0400195 BUILDMAN: "^evb-ast2500$"
196 <<: *buildman_and_testpy_dfn
197
Tom Rini1a62a722019-06-19 09:25:17 -0400198sandbox_flattree test.py:
199 tags: [ 'all' ]
200 variables:
201 TEST_PY_BD: "sandbox_flattree"
202 BUILDMAN: "^sandbox_flattree$"
203 <<: *buildman_and_testpy_dfn
204
205vexpress_ca15_tc2 test.py:
206 tags: [ 'all' ]
207 variables:
208 TEST_PY_BD: "vexpress_ca15_tc2"
209 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400210 BUILDMAN: "^vexpress_ca15_tc2$"
211 <<: *buildman_and_testpy_dfn
212
213vexpress_ca9x4 test.py:
214 tags: [ 'all' ]
215 variables:
216 TEST_PY_BD: "vexpress_ca9x4"
217 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400218 BUILDMAN: "^vexpress_ca9x4$"
219 <<: *buildman_and_testpy_dfn
220
221integratorcp_cm926ejs test.py:
222 tags: [ 'all' ]
223 variables:
224 TEST_PY_BD: "integratorcp_cm926ejs"
225 TEST_PY_TEST_SPEC: "not sleep"
226 TEST_PY_ID: "--id qemu"
Tom Rini1a62a722019-06-19 09:25:17 -0400227 BUILDMAN: "^integratorcp_cm926ejs$"
228 <<: *buildman_and_testpy_dfn
229
230qemu_arm test.py:
231 tags: [ 'all' ]
232 variables:
233 TEST_PY_BD: "qemu_arm"
234 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400235 BUILDMAN: "^qemu_arm$"
236 <<: *buildman_and_testpy_dfn
237
238qemu_arm64 test.py:
239 tags: [ 'all' ]
240 variables:
241 TEST_PY_BD: "qemu_arm64"
242 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400243 BUILDMAN: "^qemu_arm64$"
244 <<: *buildman_and_testpy_dfn
245
246qemu_mips test.py:
247 tags: [ 'all' ]
248 variables:
249 TEST_PY_BD: "qemu_mips"
250 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400251 BUILDMAN: "^qemu_mips$"
Tom Rini1a62a722019-06-19 09:25:17 -0400252 <<: *buildman_and_testpy_dfn
253
254qemu_mipsel test.py:
255 tags: [ 'all' ]
256 variables:
257 TEST_PY_BD: "qemu_mipsel"
258 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400259 BUILDMAN: "^qemu_mipsel$"
Tom Rini1a62a722019-06-19 09:25:17 -0400260 <<: *buildman_and_testpy_dfn
261
262qemu_mips64 test.py:
263 tags: [ 'all' ]
264 variables:
265 TEST_PY_BD: "qemu_mips64"
266 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400267 BUILDMAN: "^qemu_mips64$"
Tom Rini1a62a722019-06-19 09:25:17 -0400268 <<: *buildman_and_testpy_dfn
269
270qemu_mips64el test.py:
271 tags: [ 'all' ]
272 variables:
273 TEST_PY_BD: "qemu_mips64el"
274 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400275 BUILDMAN: "^qemu_mips64el$"
Tom Rini1a62a722019-06-19 09:25:17 -0400276 <<: *buildman_and_testpy_dfn
277
278qemu-ppce500 test.py:
279 tags: [ 'all' ]
280 variables:
281 TEST_PY_BD: "qemu-ppce500"
282 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400283 BUILDMAN: "^qemu-ppce500$"
Tom Rini1a62a722019-06-19 09:25:17 -0400284 <<: *buildman_and_testpy_dfn
285
Tom Rini7298d822019-08-02 11:32:37 -0400286qemu-riscv64 test.py:
287 tags: [ 'all' ]
288 variables:
289 TEST_PY_BD: "qemu-riscv64"
290 TEST_PY_TEST_SPEC: "not sleep"
291 BUILDMAN: "^qemu-riscv64$"
292 <<: *buildman_and_testpy_dfn
293
Tom Rini1a62a722019-06-19 09:25:17 -0400294qemu-x86 test.py:
295 tags: [ 'all' ]
296 variables:
297 TEST_PY_BD: "qemu-x86"
298 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400299 BUILDMAN: "^qemu-x86$"
Tom Rini1a62a722019-06-19 09:25:17 -0400300 <<: *buildman_and_testpy_dfn
301
302qemu-x86_64 test.py:
303 tags: [ 'all' ]
304 variables:
305 TEST_PY_BD: "qemu-x86_64"
306 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400307 BUILDMAN: "^qemu-x86_64$"
Tom Rini1a62a722019-06-19 09:25:17 -0400308 <<: *buildman_and_testpy_dfn
309
310zynq_zc702 test.py:
311 tags: [ 'all' ]
312 variables:
313 TEST_PY_BD: "zynq_zc702"
314 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400315 TEST_PY_ID: "--id qemu"
316 BUILDMAN: "^zynq_zc702$"
317 <<: *buildman_and_testpy_dfn
318
319xilinx_versal_virt test.py:
320 tags: [ 'all' ]
321 variables:
322 TEST_PY_BD: "xilinx_versal_virt"
323 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400324 TEST_PY_ID: "--id qemu"
325 BUILDMAN: "^xilinx_versal_virt$"
326 <<: *buildman_and_testpy_dfn
327
328xtfpga test.py:
329 tags: [ 'all' ]
330 variables:
331 TEST_PY_BD: "xtfpga"
332 TEST_PY_TEST_SPEC: "not sleep"
Tom Rini1a62a722019-06-19 09:25:17 -0400333 TEST_PY_ID: "--id qemu"
334 BUILDMAN: "^xtfpga$"
Tom Rini1a62a722019-06-19 09:25:17 -0400335 <<: *buildman_and_testpy_dfn