blob: d414140974fdc6db3d2384802e79a9e282e6bdf6 [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
Tom Rini1cdb1822019-07-24 13:09:31 -040027
Tom Rinid2244b92019-06-19 09:25:17 -040028 after_script:
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010029 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rinid2244b92019-06-19 09:25:17 -040030 script:
31 # From buildman, exit code 129 means warnings only. If we've been asked to
32 # use clang only do one configuration.
33 - if [[ "${BUILDMAN}" != "" ]]; then
34 ret=0;
Simon Glass070811f2020-02-11 17:15:19 -070035 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
Tom Rinid2244b92019-06-19 09:25:17 -040036 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
Tom Rini254b98e2019-10-04 12:12:53 -040037 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
Tom Rinid2244b92019-06-19 09:25:17 -040038 exit $ret;
39 fi;
40 fi
41 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
42 # never prevent any test from running. That way, we can always pass
43 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
44 # value.
Tom Riniebcd2142019-10-24 11:59:27 -040045 - virtualenv -p /usr/bin/python3 /tmp/venv
46 - . /tmp/venv/bin/activate
47 - pip install -r test/py/requirements.txt
Tom Rini254b98e2019-10-04 12:12:53 -040048 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
Tom Rini3fcb3f52019-10-24 11:59:17 -040049 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rinid2244b92019-06-19 09:25:17 -040050 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
51 if [[ "${TEST_PY_BD}" != "" ]]; then
52 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
53 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
54 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
55 ret=$?;
56 if [[ $ret -ne 0 ]]; then
57 exit $ret;
58 fi;
59 fi;
60
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020061build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040062 tags: [ 'all' ]
63 stage: world build
64 script:
65 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040066 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
67 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
68 ./tools/buildman/buildman -o /tmp -sdeP;
69 exit $ret;
70 fi;
Tom Rini372c6972019-07-17 17:51:28 -040071
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020072build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040073 tags: [ 'all' ]
74 stage: world build
75 script:
Tom Rini6c883102020-02-11 12:41:14 -050076 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rini7faea832019-07-18 07:28:36 -040077 - . /tmp/venv/bin/activate
78 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040079 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040080 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
81 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
82 ./tools/buildman/buildman -o /tmp -sdeP;
83 exit $ret;
84 fi;
Tom Rini372c6972019-07-17 17:51:28 -040085
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020086build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040087 tags: [ 'all' ]
88 stage: world build
89 script:
90 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -040091 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
92 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
93 ./tools/buildman/buildman -o /tmp -sdeP;
94 exit $ret;
95 fi;
Tom Rini372c6972019-07-17 17:51:28 -040096
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020097build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -040098 tags: [ 'all' ]
99 stage: world build
100 script:
101 - ret=0;
Tom Rini70c63a52019-10-24 11:59:16 -0400102 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
103 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
104 ./tools/buildman/buildman -o /tmp -sdeP;
105 exit $ret;
106 fi;
Tom Rinid2244b92019-06-19 09:25:17 -0400107
108# QA jobs for code analytics
109# static code analysis with cppcheck (we can add --enable=all later)
110cppcheck:
111 tags: [ 'all' ]
112 stage: testsuites
113 script:
114 - cppcheck --force --quiet --inline-suppr .
115
116# search for TODO within source tree
117grep TODO/FIXME/HACK:
118 tags: [ 'all' ]
119 stage: testsuites
120 script:
121 - grep -r TODO .
122 - grep -r FIXME .
123 # search for HACK within source tree and ignore HACKKIT board
124 - grep -r HACK . | grep -v HACKKIT
125
Heinrich Schuchardtbccdb652020-02-21 18:24:01 +0100126# build HTML documentation
127htmldocs:
128 tags: [ 'all' ]
129 stage: testsuites
130 script:
131 - make htmldocs
132
Tom Rinid2244b92019-06-19 09:25:17 -0400133# some statistics about the code base
134sloccount:
135 tags: [ 'all' ]
136 stage: testsuites
137 script:
138 - sloccount .
139
140# ensure all configs have MAINTAINERS entries
141Check for configs without MAINTAINERS entry:
142 tags: [ 'all' ]
143 stage: testsuites
144 script:
145 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
146
147# Ensure host tools build
148Build tools-only:
149 tags: [ 'all' ]
150 stage: testsuites
151 script:
152 - make tools-only_config tools-only -j$(nproc)
153
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200154# Ensure env tools build
155Build envtools:
156 tags: [ 'all' ]
157 stage: testsuites
158 script:
159 - make tools-only_config envtools -j$(nproc)
160
Tom Rini0b3e0c42020-03-11 18:11:15 -0400161Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400162 tags: [ 'all' ]
163 stage: testsuites
164 script:
Tom Rini0b6e1032019-08-12 10:09:08 -0400165 - git config --global user.name "GitLab CI Runner";
166 git config --global user.email trini@konsulko.com;
167 export USER=gitlab;
Tom Rini6c883102020-02-11 12:41:14 -0500168 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rini0b6e1032019-08-12 10:09:08 -0400169 . /tmp/venv/bin/activate;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400170 pip install pyelftools pytest;
Tom Rini254b98e2019-10-04 12:12:53 -0400171 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400172 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
173 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass070811f2020-02-11 17:15:19 -0700174 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400175 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
176 ./tools/buildman/buildman -t;
177 ./tools/dtoc/dtoc -t;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400178 ./tools/patman/patman --test;
179 make testconfig
Tom Rinid2244b92019-06-19 09:25:17 -0400180
181# Test sandbox with test.py
182sandbox test.py:
183 tags: [ 'all' ]
184 variables:
185 TEST_PY_BD: "sandbox"
186 BUILDMAN: "^sandbox$"
187 <<: *buildman_and_testpy_dfn
188
Tom Rini99a1bb32019-11-06 19:30:47 -0500189sandbox with clang test.py:
190 tags: [ 'all' ]
191 variables:
192 TEST_PY_BD: "sandbox"
193 BUILDMAN: "^sandbox$"
194 OVERRIDE: "-O clang-7"
195 <<: *buildman_and_testpy_dfn
196
Tom Rinid2244b92019-06-19 09:25:17 -0400197sandbox_spl test.py:
198 tags: [ 'all' ]
199 variables:
200 TEST_PY_BD: "sandbox_spl"
201 BUILDMAN: "^sandbox_spl$"
202 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: "^evb-ast2500$"
211 <<: *buildman_and_testpy_dfn
212
Tom Rinid2244b92019-06-19 09:25:17 -0400213sandbox_flattree test.py:
214 tags: [ 'all' ]
215 variables:
216 TEST_PY_BD: "sandbox_flattree"
217 BUILDMAN: "^sandbox_flattree$"
218 <<: *buildman_and_testpy_dfn
219
220vexpress_ca15_tc2 test.py:
221 tags: [ 'all' ]
222 variables:
223 TEST_PY_BD: "vexpress_ca15_tc2"
224 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400225 BUILDMAN: "^vexpress_ca15_tc2$"
226 <<: *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 Rinid2244b92019-06-19 09:25:17 -0400233 BUILDMAN: "^vexpress_ca9x4$"
234 <<: *buildman_and_testpy_dfn
235
236integratorcp_cm926ejs test.py:
237 tags: [ 'all' ]
238 variables:
239 TEST_PY_BD: "integratorcp_cm926ejs"
240 TEST_PY_TEST_SPEC: "not sleep"
241 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400242 BUILDMAN: "^integratorcp_cm926ejs$"
243 <<: *buildman_and_testpy_dfn
244
245qemu_arm test.py:
246 tags: [ 'all' ]
247 variables:
248 TEST_PY_BD: "qemu_arm"
249 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400250 BUILDMAN: "^qemu_arm$"
251 <<: *buildman_and_testpy_dfn
252
253qemu_arm64 test.py:
254 tags: [ 'all' ]
255 variables:
256 TEST_PY_BD: "qemu_arm64"
257 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400258 BUILDMAN: "^qemu_arm64$"
259 <<: *buildman_and_testpy_dfn
260
261qemu_mips test.py:
262 tags: [ 'all' ]
263 variables:
264 TEST_PY_BD: "qemu_mips"
265 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400266 BUILDMAN: "^qemu_mips$"
Tom Rinid2244b92019-06-19 09:25:17 -0400267 <<: *buildman_and_testpy_dfn
268
269qemu_mipsel test.py:
270 tags: [ 'all' ]
271 variables:
272 TEST_PY_BD: "qemu_mipsel"
273 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400274 BUILDMAN: "^qemu_mipsel$"
Tom Rinid2244b92019-06-19 09:25:17 -0400275 <<: *buildman_and_testpy_dfn
276
277qemu_mips64 test.py:
278 tags: [ 'all' ]
279 variables:
280 TEST_PY_BD: "qemu_mips64"
281 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400282 BUILDMAN: "^qemu_mips64$"
Tom Rinid2244b92019-06-19 09:25:17 -0400283 <<: *buildman_and_testpy_dfn
284
285qemu_mips64el test.py:
286 tags: [ 'all' ]
287 variables:
288 TEST_PY_BD: "qemu_mips64el"
289 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400290 BUILDMAN: "^qemu_mips64el$"
Tom Rinid2244b92019-06-19 09:25:17 -0400291 <<: *buildman_and_testpy_dfn
292
293qemu-ppce500 test.py:
294 tags: [ 'all' ]
295 variables:
296 TEST_PY_BD: "qemu-ppce500"
297 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400298 BUILDMAN: "^qemu-ppce500$"
Tom Rinid2244b92019-06-19 09:25:17 -0400299 <<: *buildman_and_testpy_dfn
300
Bin Mengaeb3ea42020-03-28 07:25:27 -0700301qemu-riscv32 test.py:
302 tags: [ 'all' ]
303 variables:
304 TEST_PY_BD: "qemu-riscv32"
305 TEST_PY_TEST_SPEC: "not sleep"
306 BUILDMAN: "^qemu-riscv32$"
307 <<: *buildman_and_testpy_dfn
308
Tom Rinic8c320e2019-08-02 11:32:37 -0400309qemu-riscv64 test.py:
310 tags: [ 'all' ]
311 variables:
312 TEST_PY_BD: "qemu-riscv64"
313 TEST_PY_TEST_SPEC: "not sleep"
314 BUILDMAN: "^qemu-riscv64$"
315 <<: *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: "^qemu-x86$"
Tom Rinid2244b92019-06-19 09:25:17 -0400323 <<: *buildman_and_testpy_dfn
324
325qemu-x86_64 test.py:
326 tags: [ 'all' ]
327 variables:
328 TEST_PY_BD: "qemu-x86_64"
329 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400330 BUILDMAN: "^qemu-x86_64$"
Tom Rinid2244b92019-06-19 09:25:17 -0400331 <<: *buildman_and_testpy_dfn
332
Michal Simekf8834fd2020-02-13 15:03:29 +0100333xilinx_zynq_virt test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400334 tags: [ 'all' ]
335 variables:
Michal Simekf8834fd2020-02-13 15:03:29 +0100336 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rinid2244b92019-06-19 09:25:17 -0400337 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400338 TEST_PY_ID: "--id qemu"
Michal Simekf8834fd2020-02-13 15:03:29 +0100339 BUILDMAN: "^xilinx_zynq_virt$"
Tom Rinid2244b92019-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 Rinid2244b92019-06-19 09:25:17 -0400347 TEST_PY_ID: "--id qemu"
348 BUILDMAN: "^xilinx_versal_virt$"
349 <<: *buildman_and_testpy_dfn
350
351xtfpga test.py:
352 tags: [ 'all' ]
353 variables:
354 TEST_PY_BD: "xtfpga"
355 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400356 TEST_PY_ID: "--id qemu"
357 BUILDMAN: "^xtfpga$"
Tom Rinid2244b92019-06-19 09:25:17 -0400358 <<: *buildman_and_testpy_dfn