blob: cb636b25a61e2d03c122eb1737cc5957f71a0168 [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
5image: trini/u-boot-gitlab-ci-runner:xenial-20190222-24April2019
6
7# We run some tests in different order, to catch some failures quicker.
8stages:
9 - test.py
10 - testsuites
11 - 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 )
31 - if [[ "${QEMU_TARGET}" != "" ]]; then
32 git clone git://git.qemu.org/qemu.git /tmp/qemu;
33 pushd /tmp/qemu;
34 git submodule update --init dtc &&
35 git checkout ${QEMU_VERSION} &&
36 ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
37 make -j$(nproc) all install;
38 popd;
39 fi
40 after_script:
41 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/qemu /tmp/venv
42 script:
43 # From buildman, exit code 129 means warnings only. If we've been asked to
44 # use clang only do one configuration.
45 - if [[ "${BUILDMAN}" != "" ]]; then
46 ret=0;
47 tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
48 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
49 tools/buildman/buildman -sdeP ${BUILDMAN};
50 exit $ret;
51 fi;
52 fi
53 # "not a_test_which_does_not_exist" is a dummy -k parameter which will
54 # never prevent any test from running. That way, we can always pass
55 # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
56 # value.
57 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
58 export PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
59 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
60 if [[ "${TEST_PY_BD}" != "" ]]; then
61 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
62 -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
63 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
64 ret=$?;
65 if [[ $ret -ne 0 ]]; then
66 exit $ret;
67 fi;
68 fi;
69
70build all plaforms:
71 tags: [ 'all' ]
72 stage: world build
73 script:
74 - ret=0;
75 ./tools/buildman/buildman -P -E || ret=$?;
76 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
77 ./tools/buildman/buildman -sdeP;
78 exit $ret;
79 fi;
80
81# QA jobs for code analytics
82# static code analysis with cppcheck (we can add --enable=all later)
83cppcheck:
84 tags: [ 'all' ]
85 stage: testsuites
86 script:
87 - cppcheck --force --quiet --inline-suppr .
88
89# search for TODO within source tree
90grep TODO/FIXME/HACK:
91 tags: [ 'all' ]
92 stage: testsuites
93 script:
94 - grep -r TODO .
95 - grep -r FIXME .
96 # search for HACK within source tree and ignore HACKKIT board
97 - grep -r HACK . | grep -v HACKKIT
98
99# some statistics about the code base
100sloccount:
101 tags: [ 'all' ]
102 stage: testsuites
103 script:
104 - sloccount .
105
106# ensure all configs have MAINTAINERS entries
107Check for configs without MAINTAINERS entry:
108 tags: [ 'all' ]
109 stage: testsuites
110 script:
111 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
112
113# Ensure host tools build
114Build tools-only:
115 tags: [ 'all' ]
116 stage: testsuites
117 script:
118 - make tools-only_config tools-only -j$(nproc)
119
120# Run various tool tests
121Run patman testsuite:
122 tags: [ 'all' ]
123 stage: testsuites
124 script:
125 - git config --global user.name "GitLab CI Runner"
126 - git config --global user.email trini@konsulko.com
127 - ./tools/patman/patman --test
128
129Run buildman testsuite:
130 tags: [ 'all' ]
131 stage: testsuites
132 script:
133 - ./tools/buildman/buildman -t
134
135Run binman and dtoc testsuite:
136 tags: [ 'all' ]
137 stage: testsuites
138 script:
139 - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl;
140 ./tools/buildman/buildman -P sandbox_spl &&
141 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
142 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
143 ./tools/binman/binman -t &&
144 ./tools/dtoc/dtoc -t
145
146# Test sandbox with test.py
147sandbox test.py:
148 tags: [ 'all' ]
149 variables:
150 TEST_PY_BD: "sandbox"
151 BUILDMAN: "^sandbox$"
152 <<: *buildman_and_testpy_dfn
153
154sandbox_spl test.py:
155 tags: [ 'all' ]
156 variables:
157 TEST_PY_BD: "sandbox_spl"
158 BUILDMAN: "^sandbox_spl$"
159 TEST_PY_TEST_SPEC: "test_ofplatdata"
160 <<: *buildman_and_testpy_dfn
161
Tom Rini0008b882019-07-17 16:06:57 -0400162evb-ast2500 test.py:
163 tags: [ 'all' ]
164 variables:
165 TEST_PY_BD: "evb-ast2500"
166 TEST_PY_ID: "--id qemu"
167 QEMU_TARGET: "arm-softmmu"
168 QEMU_VERSION: "506179e42112be77bfd071f050b15762d3b2cd43"
169 BUILDMAN: "^evb-ast2500$"
170 <<: *buildman_and_testpy_dfn
171
Tom Rinid2244b92019-06-19 09:25:17 -0400172sandbox_flattree test.py:
173 tags: [ 'all' ]
174 variables:
175 TEST_PY_BD: "sandbox_flattree"
176 BUILDMAN: "^sandbox_flattree$"
177 <<: *buildman_and_testpy_dfn
178
179vexpress_ca15_tc2 test.py:
180 tags: [ 'all' ]
181 variables:
182 TEST_PY_BD: "vexpress_ca15_tc2"
183 TEST_PY_ID: "--id qemu"
184 QEMU_TARGET: "arm-softmmu"
185 QEMU_VERSION: "v3.0.0"
186 BUILDMAN: "^vexpress_ca15_tc2$"
187 <<: *buildman_and_testpy_dfn
188
189vexpress_ca9x4 test.py:
190 tags: [ 'all' ]
191 variables:
192 TEST_PY_BD: "vexpress_ca9x4"
193 TEST_PY_ID: "--id qemu"
194 QEMU_TARGET: "arm-softmmu"
195 BUILDMAN: "^vexpress_ca9x4$"
196 <<: *buildman_and_testpy_dfn
197
198integratorcp_cm926ejs test.py:
199 tags: [ 'all' ]
200 variables:
201 TEST_PY_BD: "integratorcp_cm926ejs"
202 TEST_PY_TEST_SPEC: "not sleep"
203 TEST_PY_ID: "--id qemu"
204 QEMU_TARGET: "arm-softmmu"
205 BUILDMAN: "^integratorcp_cm926ejs$"
206 <<: *buildman_and_testpy_dfn
207
208qemu_arm test.py:
209 tags: [ 'all' ]
210 variables:
211 TEST_PY_BD: "qemu_arm"
212 TEST_PY_TEST_SPEC: "not sleep"
213 QEMU_TARGET: "arm-softmmu"
214 BUILDMAN: "^qemu_arm$"
215 <<: *buildman_and_testpy_dfn
216
217qemu_arm64 test.py:
218 tags: [ 'all' ]
219 variables:
220 TEST_PY_BD: "qemu_arm64"
221 TEST_PY_TEST_SPEC: "not sleep"
222 QEMU_TARGET: "aarch64-softmmu"
223 BUILDMAN: "^qemu_arm64$"
224 <<: *buildman_and_testpy_dfn
225
226qemu_mips test.py:
227 tags: [ 'all' ]
228 variables:
229 TEST_PY_BD: "qemu_mips"
230 TEST_PY_TEST_SPEC: "not sleep"
231 QEMU_TARGET: "mips-softmmu"
232 BUILDMAN: "^qemu_mips$"
233 TOOLCHAIN: "mips"
234 <<: *buildman_and_testpy_dfn
235
236qemu_mipsel test.py:
237 tags: [ 'all' ]
238 variables:
239 TEST_PY_BD: "qemu_mipsel"
240 TEST_PY_TEST_SPEC: "not sleep"
241 QEMU_TARGET: "mipsel-softmmu"
242 BUILDMAN: "^qemu_mipsel$"
243 TOOLCHAIN: "mips"
244 <<: *buildman_and_testpy_dfn
245
246qemu_mips64 test.py:
247 tags: [ 'all' ]
248 variables:
249 TEST_PY_BD: "qemu_mips64"
250 TEST_PY_TEST_SPEC: "not sleep"
251 QEMU_TARGET: "mips64-softmmu"
252 BUILDMAN: "^qemu_mips64$"
253 TOOLCHAIN: "mips"
254 <<: *buildman_and_testpy_dfn
255
256qemu_mips64el test.py:
257 tags: [ 'all' ]
258 variables:
259 TEST_PY_BD: "qemu_mips64el"
260 TEST_PY_TEST_SPEC: "not sleep"
261 QEMU_TARGET: "mips64el-softmmu"
262 BUILDMAN: "^qemu_mips64el$"
263 TOOLCHAIN: "mips"
264 <<: *buildman_and_testpy_dfn
265
266qemu-ppce500 test.py:
267 tags: [ 'all' ]
268 variables:
269 TEST_PY_BD: "qemu-ppce500"
270 TEST_PY_TEST_SPEC: "not sleep"
271 QEMU_TARGET: "ppc-softmmu"
272 BUILDMAN: "^qemu-ppce500$"
273 TOOLCHAIN: "powerpc"
274 <<: *buildman_and_testpy_dfn
275
276qemu-x86 test.py:
277 tags: [ 'all' ]
278 variables:
279 TEST_PY_BD: "qemu-x86"
280 TEST_PY_TEST_SPEC: "not sleep"
281 QEMU_TARGET: "i386-softmmu"
282 BUILDMAN: "^qemu-x86$"
283 TOOLCHAIN: "i386"
284 <<: *buildman_and_testpy_dfn
285
286qemu-x86_64 test.py:
287 tags: [ 'all' ]
288 variables:
289 TEST_PY_BD: "qemu-x86_64"
290 TEST_PY_TEST_SPEC: "not sleep"
291 QEMU_TARGET: "x86_64-softmmu"
292 BUILDMAN: "^qemu-x86_64$"
293 TOOLCHAIN: "i386"
294 <<: *buildman_and_testpy_dfn
295
296zynq_zc702 test.py:
297 tags: [ 'all' ]
298 variables:
299 TEST_PY_BD: "zynq_zc702"
300 TEST_PY_TEST_SPEC: "not sleep"
301 QEMU_TARGET: "arm-softmmu"
302 TEST_PY_ID: "--id qemu"
303 BUILDMAN: "^zynq_zc702$"
304 <<: *buildman_and_testpy_dfn
305
306xilinx_versal_virt test.py:
307 tags: [ 'all' ]
308 variables:
309 TEST_PY_BD: "xilinx_versal_virt"
310 TEST_PY_TEST_SPEC: "not sleep"
311 QEMU_TARGET: "aarch64-softmmu"
312 TEST_PY_ID: "--id qemu"
313 BUILDMAN: "^xilinx_versal_virt$"
314 <<: *buildman_and_testpy_dfn
315
316xtfpga test.py:
317 tags: [ 'all' ]
318 variables:
319 TEST_PY_BD: "xtfpga"
320 TEST_PY_TEST_SPEC: "not sleep"
321 QEMU_TARGET: "xtensa-softmmu"
322 TEST_PY_ID: "--id qemu"
323 BUILDMAN: "^xtfpga$"
324 TOOLCHAIN: "xtensa-dc233c-elf"
325 <<: *buildman_and_testpy_dfn