blob: b91b5f67af98ed09b04f164b8922fac8bab4e52a [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 Rini6ad26042019-10-04 12:12:54 -04005image: trini/u-boot-gitlab-ci-runner:bionic-20190912.1-03Oct2019
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`
21 - virtualenv /tmp/venv
22 - . /tmp/venv/bin/activate
23 - pip install pytest==2.8.7
24 - pip install python-subunit
Tom Rini6ad26042019-10-04 12:12:54 -040025 - pip install coverage
26 - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
27 - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
Tom Rinid2244b92019-06-19 09:25:17 -040028 - mkdir ~/grub2-arm
29 - ( 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 )
30 - mkdir ~/grub2-arm64
31 - ( 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 Rini1cdb1822019-07-24 13:09:31 -040032
Tom Rinid2244b92019-06-19 09:25:17 -040033 after_script:
Tom Rini1cdb1822019-07-24 13:09:31 -040034 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
Tom Rinid2244b92019-06-19 09:25:17 -040035 script:
36 # From buildman, exit code 129 means warnings only. If we've been asked to
37 # use clang only do one configuration.
38 - if [[ "${BUILDMAN}" != "" ]]; then
39 ret=0;
Tom Rini254b98e2019-10-04 12:12:53 -040040 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
Tom Rinid2244b92019-06-19 09:25:17 -040041 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rini254b98e2019-10-04 12:12:53 -040042 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
Tom Rinid2244b92019-06-19 09:25:17 -040043 exit $ret;
44 fi;
45 fi
46 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
47 # never prevent any test from running. That way, we can always pass
48 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
49 # value.
Tom Rini254b98e2019-10-04 12:12:53 -040050 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
Tom Rini1cdb1822019-07-24 13:09:31 -040051 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
Tom Rinid2244b92019-06-19 09:25:17 -040052 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
53 if [[ "${TEST_PY_BD}" != "" ]]; then
54 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
55 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
56 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
57 ret=$?;
58 if [[ $ret -ne 0 ]]; then
59 exit $ret;
60 fi;
61 fi;
62
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020063build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040064 tags: [ 'all' ]
65 stage: world build
66 script:
67 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040068 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
69 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
70 ./tools/buildman/buildman -o /tmp -sdeP;
71 exit $ret;
72 fi;
Tom Rini372c6972019-07-17 17:51:28 -040073
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020074build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040075 tags: [ 'all' ]
76 stage: world build
77 script:
Tom Rini7faea832019-07-18 07:28:36 -040078 - virtualenv /tmp/venv
79 - . /tmp/venv/bin/activate
80 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040081 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040082 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
83 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
84 ./tools/buildman/buildman -o /tmp -sdeP;
85 exit $ret;
86 fi;
Tom Rini372c6972019-07-17 17:51:28 -040087
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020088build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040089 tags: [ 'all' ]
90 stage: world build
91 script:
92 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040093 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
94 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
95 ./tools/buildman/buildman -o /tmp -sdeP;
96 exit $ret;
97 fi;
Tom Rini372c6972019-07-17 17:51:28 -040098
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020099build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -0400100 tags: [ 'all' ]
101 stage: world build
102 script:
103 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -0400104 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
105 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
106 ./tools/buildman/buildman -o /tmp -sdeP;
107 exit $ret;
108 fi;
Tom Rinid2244b92019-06-19 09:25:17 -0400109
110# QA jobs for code analytics
111# static code analysis with cppcheck (we can add --enable=all later)
112cppcheck:
113 tags: [ 'all' ]
114 stage: testsuites
115 script:
116 - cppcheck --force --quiet --inline-suppr .
117
118# search for TODO within source tree
119grep TODO/FIXME/HACK:
120 tags: [ 'all' ]
121 stage: testsuites
122 script:
123 - grep -r TODO .
124 - grep -r FIXME .
125 # search for HACK within source tree and ignore HACKKIT board
126 - grep -r HACK . | grep -v HACKKIT
127
128# some statistics about the code base
129sloccount:
130 tags: [ 'all' ]
131 stage: testsuites
132 script:
133 - sloccount .
134
135# ensure all configs have MAINTAINERS entries
136Check for configs without MAINTAINERS entry:
137 tags: [ 'all' ]
138 stage: testsuites
139 script:
140 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
141
142# Ensure host tools build
143Build tools-only:
144 tags: [ 'all' ]
145 stage: testsuites
146 script:
147 - make tools-only_config tools-only -j$(nproc)
148
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200149# Ensure env tools build
150Build envtools:
151 tags: [ 'all' ]
152 stage: testsuites
153 script:
154 - make tools-only_config envtools -j$(nproc)
155
Tom Rini0b6e1032019-08-12 10:09:08 -0400156Run binman, buildman, dtoc and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400157 tags: [ 'all' ]
158 stage: testsuites
159 script:
Tom Rini0b6e1032019-08-12 10:09:08 -0400160 - git config --global user.name "GitLab CI Runner";
161 git config --global user.email trini@konsulko.com;
162 export USER=gitlab;
163 virtualenv /tmp/venv;
164 . /tmp/venv/bin/activate;
165 pip install pyelftools;
Tom Rini254b98e2019-10-04 12:12:53 -0400166 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400167 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
168 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Tom Rini254b98e2019-10-04 12:12:53 -0400169 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400170 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
171 ./tools/buildman/buildman -t;
172 ./tools/dtoc/dtoc -t;
173 ./tools/patman/patman --test
Tom Rinid2244b92019-06-19 09:25:17 -0400174
175# Test sandbox with test.py
176sandbox test.py:
177 tags: [ 'all' ]
178 variables:
179 TEST_PY_BD: "sandbox"
180 BUILDMAN: "^sandbox$"
181 <<: *buildman_and_testpy_dfn
182
183sandbox_spl test.py:
184 tags: [ 'all' ]
185 variables:
186 TEST_PY_BD: "sandbox_spl"
187 BUILDMAN: "^sandbox_spl$"
188 TEST_PY_TEST_SPEC: "test_ofplatdata"
189 <<: *buildman_and_testpy_dfn
190
Tom Rini0008b882019-07-17 16:06:57 -0400191evb-ast2500 test.py:
192 tags: [ 'all' ]
193 variables:
194 TEST_PY_BD: "evb-ast2500"
195 TEST_PY_ID: "--id qemu"
Tom Rini0008b882019-07-17 16:06:57 -0400196 BUILDMAN: "^evb-ast2500$"
197 <<: *buildman_and_testpy_dfn
198
Tom Rinid2244b92019-06-19 09:25:17 -0400199sandbox_flattree test.py:
200 tags: [ 'all' ]
201 variables:
202 TEST_PY_BD: "sandbox_flattree"
203 BUILDMAN: "^sandbox_flattree$"
204 <<: *buildman_and_testpy_dfn
205
206vexpress_ca15_tc2 test.py:
207 tags: [ 'all' ]
208 variables:
209 TEST_PY_BD: "vexpress_ca15_tc2"
210 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400211 BUILDMAN: "^vexpress_ca15_tc2$"
212 <<: *buildman_and_testpy_dfn
213
214vexpress_ca9x4 test.py:
215 tags: [ 'all' ]
216 variables:
217 TEST_PY_BD: "vexpress_ca9x4"
218 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400219 BUILDMAN: "^vexpress_ca9x4$"
220 <<: *buildman_and_testpy_dfn
221
222integratorcp_cm926ejs test.py:
223 tags: [ 'all' ]
224 variables:
225 TEST_PY_BD: "integratorcp_cm926ejs"
226 TEST_PY_TEST_SPEC: "not sleep"
227 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400228 BUILDMAN: "^integratorcp_cm926ejs$"
229 <<: *buildman_and_testpy_dfn
230
231qemu_arm test.py:
232 tags: [ 'all' ]
233 variables:
234 TEST_PY_BD: "qemu_arm"
235 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400236 BUILDMAN: "^qemu_arm$"
237 <<: *buildman_and_testpy_dfn
238
239qemu_arm64 test.py:
240 tags: [ 'all' ]
241 variables:
242 TEST_PY_BD: "qemu_arm64"
243 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400244 BUILDMAN: "^qemu_arm64$"
245 <<: *buildman_and_testpy_dfn
246
247qemu_mips test.py:
248 tags: [ 'all' ]
249 variables:
250 TEST_PY_BD: "qemu_mips"
251 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400252 BUILDMAN: "^qemu_mips$"
Tom Rinid2244b92019-06-19 09:25:17 -0400253 <<: *buildman_and_testpy_dfn
254
255qemu_mipsel test.py:
256 tags: [ 'all' ]
257 variables:
258 TEST_PY_BD: "qemu_mipsel"
259 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400260 BUILDMAN: "^qemu_mipsel$"
Tom Rinid2244b92019-06-19 09:25:17 -0400261 <<: *buildman_and_testpy_dfn
262
263qemu_mips64 test.py:
264 tags: [ 'all' ]
265 variables:
266 TEST_PY_BD: "qemu_mips64"
267 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400268 BUILDMAN: "^qemu_mips64$"
Tom Rinid2244b92019-06-19 09:25:17 -0400269 <<: *buildman_and_testpy_dfn
270
271qemu_mips64el test.py:
272 tags: [ 'all' ]
273 variables:
274 TEST_PY_BD: "qemu_mips64el"
275 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400276 BUILDMAN: "^qemu_mips64el$"
Tom Rinid2244b92019-06-19 09:25:17 -0400277 <<: *buildman_and_testpy_dfn
278
279qemu-ppce500 test.py:
280 tags: [ 'all' ]
281 variables:
282 TEST_PY_BD: "qemu-ppce500"
283 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400284 BUILDMAN: "^qemu-ppce500$"
Tom Rinid2244b92019-06-19 09:25:17 -0400285 <<: *buildman_and_testpy_dfn
286
Tom Rinic8c320e2019-08-02 11:32:37 -0400287qemu-riscv64 test.py:
288 tags: [ 'all' ]
289 variables:
290 TEST_PY_BD: "qemu-riscv64"
291 TEST_PY_TEST_SPEC: "not sleep"
292 BUILDMAN: "^qemu-riscv64$"
293 <<: *buildman_and_testpy_dfn
294
Tom Rinid2244b92019-06-19 09:25:17 -0400295qemu-x86 test.py:
296 tags: [ 'all' ]
297 variables:
298 TEST_PY_BD: "qemu-x86"
299 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400300 BUILDMAN: "^qemu-x86$"
Tom Rinid2244b92019-06-19 09:25:17 -0400301 <<: *buildman_and_testpy_dfn
302
303qemu-x86_64 test.py:
304 tags: [ 'all' ]
305 variables:
306 TEST_PY_BD: "qemu-x86_64"
307 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400308 BUILDMAN: "^qemu-x86_64$"
Tom Rinid2244b92019-06-19 09:25:17 -0400309 <<: *buildman_and_testpy_dfn
310
311zynq_zc702 test.py:
312 tags: [ 'all' ]
313 variables:
314 TEST_PY_BD: "zynq_zc702"
315 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400316 TEST_PY_ID: "--id qemu"
317 BUILDMAN: "^zynq_zc702$"
318 <<: *buildman_and_testpy_dfn
319
320xilinx_versal_virt test.py:
321 tags: [ 'all' ]
322 variables:
323 TEST_PY_BD: "xilinx_versal_virt"
324 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400325 TEST_PY_ID: "--id qemu"
326 BUILDMAN: "^xilinx_versal_virt$"
327 <<: *buildman_and_testpy_dfn
328
329xtfpga test.py:
330 tags: [ 'all' ]
331 variables:
332 TEST_PY_BD: "xtfpga"
333 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400334 TEST_PY_ID: "--id qemu"
335 BUILDMAN: "^xtfpga$"
Tom Rinid2244b92019-06-19 09:25:17 -0400336 <<: *buildman_and_testpy_dfn