]> git.ipfire.org Git - thirdparty/u-boot.git/blame - .gitlab-ci.yml
travis: Split i.MX jobs a bit more
[thirdparty/u-boot.git] / .gitlab-ci.yml
CommitLineData
1a62a722
TR
1# 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
28a51234 5image: trini/u-boot-gitlab-ci-runner:bionic-20190912.1-03Oct2019
1a62a722
TR
6
7# We run some tests in different order, to catch some failures quicker.
8stages:
1a62a722 9 - testsuites
b29cb058 10 - test.py
1a62a722
TR
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
28a51234
TR
25 - 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
1a62a722
TR
28 - 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 )
b29cb058 32
1a62a722 33 after_script:
b29cb058 34 - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/venv
1a62a722
TR
35 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;
db7b8602 40 tools/buildman/buildman -o /tmp -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?;
1a62a722 41 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
db7b8602 42 tools/buildman/buildman -o /tmp -sdeP ${BUILDMAN};
1a62a722
TR
43 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.
db7b8602 50 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/${TEST_PY_BD};
b29cb058 51 export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin;
1a62a722
TR
52 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
a11cb57d 63build all 32bit ARM platforms:
1a62a722
TR
64 tags: [ 'all' ]
65 stage: world build
66 script:
67 - ret=0;
db7b8602 68 ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?;
9f7bda10 69 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
db7b8602 70 ./tools/buildman/buildman -o /tmp -sdeP;
9f7bda10
TR
71 exit $ret;
72 fi;
73
a11cb57d 74build all 64bit ARM platforms:
9f7bda10
TR
75 tags: [ 'all' ]
76 stage: world build
77 script:
f0db8395
TR
78 - virtualenv /tmp/venv
79 - . /tmp/venv/bin/activate
80 - pip install pyelftools
9f7bda10 81 - ret=0;
db7b8602 82 ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?;
9f7bda10 83 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
db7b8602 84 ./tools/buildman/buildman -o /tmp -sdeP;
9f7bda10
TR
85 exit $ret;
86 fi;
87
a11cb57d 88build all PowerPC platforms:
9f7bda10
TR
89 tags: [ 'all' ]
90 stage: world build
91 script:
92 - ret=0;
db7b8602 93 ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?;
9f7bda10 94 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
db7b8602 95 ./tools/buildman/buildman -o /tmp -sdeP;
9f7bda10
TR
96 exit $ret;
97 fi;
98
a11cb57d 99build all other platforms:
9f7bda10
TR
100 tags: [ 'all' ]
101 stage: world build
102 script:
103 - ret=0;
db7b8602 104 ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?;
1a62a722 105 if [[ $ret -ne 0 && $ret -ne 129 ]]; then
db7b8602 106 ./tools/buildman/buildman -o /tmp -sdeP;
1a62a722
TR
107 exit $ret;
108 fi;
109
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
1f3910da
PJT
149# Ensure env tools build
150Build envtools:
151 tags: [ 'all' ]
152 stage: testsuites
153 script:
154 - make tools-only_config envtools -j$(nproc)
155
d7ae9321 156Run binman, buildman, dtoc and patman testsuites:
1a62a722
TR
157 tags: [ 'all' ]
158 stage: testsuites
159 script:
d7ae9321
TR
160 - 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;
db7b8602 166 export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
d7ae9321
TR
167 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
168 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
db7b8602 169 ./tools/buildman/buildman -o /tmp -P sandbox_spl;
d7ae9321
TR
170 ./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
1a62a722
TR
174
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
699c0b93
TR
191evb-ast2500 test.py:
192 tags: [ 'all' ]
193 variables:
194 TEST_PY_BD: "evb-ast2500"
195 TEST_PY_ID: "--id qemu"
699c0b93
TR
196 BUILDMAN: "^evb-ast2500$"
197 <<: *buildman_and_testpy_dfn
198
1a62a722
TR
199sandbox_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"
1a62a722
TR
211 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"
1a62a722
TR
219 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"
1a62a722
TR
228 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"
1a62a722
TR
236 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"
1a62a722
TR
244 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"
1a62a722 252 BUILDMAN: "^qemu_mips$"
1a62a722
TR
253 <<: *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"
1a62a722 260 BUILDMAN: "^qemu_mipsel$"
1a62a722
TR
261 <<: *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"
1a62a722 268 BUILDMAN: "^qemu_mips64$"
1a62a722
TR
269 <<: *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"
1a62a722 276 BUILDMAN: "^qemu_mips64el$"
1a62a722
TR
277 <<: *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"
1a62a722 284 BUILDMAN: "^qemu-ppce500$"
1a62a722
TR
285 <<: *buildman_and_testpy_dfn
286
7298d82d
TR
287qemu-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
1a62a722
TR
295qemu-x86 test.py:
296 tags: [ 'all' ]
297 variables:
298 TEST_PY_BD: "qemu-x86"
299 TEST_PY_TEST_SPEC: "not sleep"
1a62a722 300 BUILDMAN: "^qemu-x86$"
1a62a722
TR
301 <<: *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"
1a62a722 308 BUILDMAN: "^qemu-x86_64$"
1a62a722
TR
309 <<: *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"
1a62a722
TR
316 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"
1a62a722
TR
325 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"
1a62a722
TR
334 TEST_PY_ID: "--id qemu"
335 BUILDMAN: "^xtfpga$"
1a62a722 336 <<: *buildman_and_testpy_dfn