]>
Commit | Line | Data |
---|---|---|
1a62a722 TR |
1 | # SPDX-License-Identifier: GPL-2.0+ |
2 | ||
3 | # Grab our configured image. The source for this is found at: | |
a3bbd0b9 | 4 | # https://source.denx.de/u-boot/gitlab-ci-runner |
71490773 | 5 | image: trini/u-boot-gitlab-ci-runner:bionic-20200807-02Sep2020 |
1a62a722 TR |
6 | |
7 | # We run some tests in different order, to catch some failures quicker. | |
8 | stages: | |
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` | |
28a51234 TR |
21 | - 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 | |
49fb28a4 | 23 | - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then |
d20d0a57 BM |
24 | wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ; |
25 | export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin; | |
49fb28a4 BM |
26 | fi |
27 | - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then | |
d20d0a57 BM |
28 | wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ; |
29 | export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin; | |
49fb28a4 | 30 | fi |
b29cb058 | 31 | |
1a62a722 | 32 | after_script: |
24df1b14 | 33 | - rm -rf /tmp/uboot-test-hooks /tmp/venv |
1a62a722 | 34 | script: |
dd5c954e | 35 | # If we've been asked to use clang only do one configuration. |
4e32fed4 | 36 | - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD} |
7ec1255c SG |
37 | - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e |
38 | --board ${TEST_PY_BD} ${OVERRIDE} | |
82560ae2 HS |
39 | - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/ |
40 | - cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/ | |
41 | - cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi | |
42 | - cp /opt/grub/grubriscv32.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv32.efi | |
43 | - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi | |
44 | - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi | |
085b8978 TR |
45 | - virtualenv -p /usr/bin/python3 /tmp/venv |
46 | - . /tmp/venv/bin/activate | |
47 | - pip install -r test/py/requirements.txt | |
4080d097 | 48 | # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not |
4e32fed4 | 49 | - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH}; |
1a62a722 | 50 | export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; |
f3092473 | 51 | ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} |
4080d097 | 52 | ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} |
cec1e856 | 53 | --build-dir "$UBOOT_TRAVIS_BUILD_DIR" |
1a62a722 | 54 | |
a11cb57d | 55 | build all 32bit ARM platforms: |
1a62a722 TR |
56 | tags: [ 'all' ] |
57 | stage: world build | |
58 | script: | |
59 | - ret=0; | |
dd5c954e SG |
60 | ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?; |
61 | if [[ $ret -ne 0 ]]; then | |
b52f5a19 | 62 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
63 | exit $ret; |
64 | fi; | |
9f7bda10 | 65 | |
a11cb57d | 66 | build all 64bit ARM platforms: |
9f7bda10 TR |
67 | tags: [ 'all' ] |
68 | stage: world build | |
69 | script: | |
26a426a1 | 70 | - virtualenv -p /usr/bin/python3 /tmp/venv |
f0db8395 TR |
71 | - . /tmp/venv/bin/activate |
72 | - pip install pyelftools | |
9f7bda10 | 73 | - ret=0; |
dd5c954e SG |
74 | ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?; |
75 | if [[ $ret -ne 0 ]]; then | |
b52f5a19 | 76 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
77 | exit $ret; |
78 | fi; | |
9f7bda10 | 79 | |
a11cb57d | 80 | build all PowerPC platforms: |
9f7bda10 TR |
81 | tags: [ 'all' ] |
82 | stage: world build | |
83 | script: | |
84 | - ret=0; | |
dd5c954e SG |
85 | ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?; |
86 | if [[ $ret -ne 0 ]]; then | |
b52f5a19 | 87 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
88 | exit $ret; |
89 | fi; | |
9f7bda10 | 90 | |
a11cb57d | 91 | build all other platforms: |
9f7bda10 TR |
92 | tags: [ 'all' ] |
93 | stage: world build | |
94 | script: | |
95 | - ret=0; | |
dd5c954e SG |
96 | ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?; |
97 | if [[ $ret -ne 0 ]]; then | |
b52f5a19 | 98 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
99 | exit $ret; |
100 | fi; | |
1a62a722 TR |
101 | |
102 | # QA jobs for code analytics | |
103 | # static code analysis with cppcheck (we can add --enable=all later) | |
104 | cppcheck: | |
105 | tags: [ 'all' ] | |
106 | stage: testsuites | |
107 | script: | |
4ee7f527 | 108 | - cppcheck -j$(nproc) --force --quiet --inline-suppr . |
1a62a722 TR |
109 | |
110 | # search for TODO within source tree | |
111 | grep TODO/FIXME/HACK: | |
112 | tags: [ 'all' ] | |
113 | stage: testsuites | |
114 | script: | |
115 | - grep -r TODO . | |
116 | - grep -r FIXME . | |
117 | # search for HACK within source tree and ignore HACKKIT board | |
118 | - grep -r HACK . | grep -v HACKKIT | |
119 | ||
3eb7b78b HS |
120 | # build HTML documentation |
121 | htmldocs: | |
122 | tags: [ 'all' ] | |
123 | stage: testsuites | |
124 | script: | |
836049d6 HS |
125 | - virtualenv -p /usr/bin/python3 /tmp/venvhtml |
126 | - . /tmp/venvhtml/bin/activate | |
127 | - pip install -r doc/sphinx/requirements.txt | |
3eb7b78b HS |
128 | - make htmldocs |
129 | ||
1a62a722 TR |
130 | # some statistics about the code base |
131 | sloccount: | |
132 | tags: [ 'all' ] | |
133 | stage: testsuites | |
134 | script: | |
135 | - sloccount . | |
136 | ||
137 | # ensure all configs have MAINTAINERS entries | |
138 | Check for configs without MAINTAINERS entry: | |
139 | tags: [ 'all' ] | |
140 | stage: testsuites | |
141 | script: | |
142 | - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi | |
143 | ||
144 | # Ensure host tools build | |
145 | Build tools-only: | |
146 | tags: [ 'all' ] | |
147 | stage: testsuites | |
148 | script: | |
149 | - make tools-only_config tools-only -j$(nproc) | |
150 | ||
1f3910da PJT |
151 | # Ensure env tools build |
152 | Build envtools: | |
153 | tags: [ 'all' ] | |
154 | stage: testsuites | |
155 | script: | |
156 | - make tools-only_config envtools -j$(nproc) | |
157 | ||
7261833f | 158 | Run binman, buildman, dtoc, Kconfig and patman testsuites: |
1a62a722 TR |
159 | tags: [ 'all' ] |
160 | stage: testsuites | |
161 | script: | |
d7ae9321 TR |
162 | - git config --global user.name "GitLab CI Runner"; |
163 | git config --global user.email [email protected]; | |
164 | export USER=gitlab; | |
26a426a1 | 165 | virtualenv -p /usr/bin/python3 /tmp/venv; |
d7ae9321 | 166 | . /tmp/venv/bin/activate; |
bd73bb44 | 167 | pip install pyelftools pytest pygit2; |
bf0a8133 | 168 | export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl; |
d7ae9321 TR |
169 | export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"; |
170 | export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"; | |
bf0a8133 | 171 | ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl; |
d7ae9321 TR |
172 | ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test; |
173 | ./tools/buildman/buildman -t; | |
174 | ./tools/dtoc/dtoc -t; | |
6bb74de7 | 175 | ./tools/patman/patman test; |
7261833f | 176 | make testconfig |
1a62a722 | 177 | |
6cfd09d4 T |
178 | Run tests for Nokia RX-51 (aka N900): |
179 | tags: [ 'all' ] | |
180 | stage: testsuites | |
181 | script: | |
182 | - ./tools/buildman/buildman --fetch-arch arm; | |
183 | export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH; | |
184 | test/nokia_rx51_test.sh | |
185 | ||
1a62a722 TR |
186 | # Test sandbox with test.py |
187 | sandbox test.py: | |
188 | tags: [ 'all' ] | |
189 | variables: | |
190 | TEST_PY_BD: "sandbox" | |
1a62a722 TR |
191 | <<: *buildman_and_testpy_dfn |
192 | ||
0219d014 TR |
193 | sandbox with clang test.py: |
194 | tags: [ 'all' ] | |
195 | variables: | |
196 | TEST_PY_BD: "sandbox" | |
c8790bee | 197 | OVERRIDE: "-O clang-10" |
0219d014 TR |
198 | <<: *buildman_and_testpy_dfn |
199 | ||
1a62a722 TR |
200 | sandbox_spl test.py: |
201 | tags: [ 'all' ] | |
202 | variables: | |
203 | TEST_PY_BD: "sandbox_spl" | |
afb26ba9 | 204 | TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl" |
1a62a722 TR |
205 | <<: *buildman_and_testpy_dfn |
206 | ||
699c0b93 TR |
207 | evb-ast2500 test.py: |
208 | tags: [ 'all' ] | |
209 | variables: | |
210 | TEST_PY_BD: "evb-ast2500" | |
211 | TEST_PY_ID: "--id qemu" | |
699c0b93 TR |
212 | <<: *buildman_and_testpy_dfn |
213 | ||
1a62a722 TR |
214 | sandbox_flattree test.py: |
215 | tags: [ 'all' ] | |
216 | variables: | |
217 | TEST_PY_BD: "sandbox_flattree" | |
1a62a722 TR |
218 | <<: *buildman_and_testpy_dfn |
219 | ||
220 | vexpress_ca15_tc2 test.py: | |
221 | tags: [ 'all' ] | |
222 | variables: | |
223 | TEST_PY_BD: "vexpress_ca15_tc2" | |
224 | TEST_PY_ID: "--id qemu" | |
1a62a722 TR |
225 | <<: *buildman_and_testpy_dfn |
226 | ||
227 | vexpress_ca9x4 test.py: | |
228 | tags: [ 'all' ] | |
229 | variables: | |
230 | TEST_PY_BD: "vexpress_ca9x4" | |
231 | TEST_PY_ID: "--id qemu" | |
1a62a722 TR |
232 | <<: *buildman_and_testpy_dfn |
233 | ||
234 | integratorcp_cm926ejs test.py: | |
235 | tags: [ 'all' ] | |
236 | variables: | |
237 | TEST_PY_BD: "integratorcp_cm926ejs" | |
238 | TEST_PY_TEST_SPEC: "not sleep" | |
239 | TEST_PY_ID: "--id qemu" | |
1a62a722 TR |
240 | <<: *buildman_and_testpy_dfn |
241 | ||
242 | qemu_arm test.py: | |
243 | tags: [ 'all' ] | |
244 | variables: | |
245 | TEST_PY_BD: "qemu_arm" | |
246 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
247 | <<: *buildman_and_testpy_dfn |
248 | ||
249 | qemu_arm64 test.py: | |
250 | tags: [ 'all' ] | |
251 | variables: | |
252 | TEST_PY_BD: "qemu_arm64" | |
253 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
254 | <<: *buildman_and_testpy_dfn |
255 | ||
256 | qemu_mips test.py: | |
257 | tags: [ 'all' ] | |
258 | variables: | |
259 | TEST_PY_BD: "qemu_mips" | |
260 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
261 | <<: *buildman_and_testpy_dfn |
262 | ||
263 | qemu_mipsel test.py: | |
264 | tags: [ 'all' ] | |
265 | variables: | |
266 | TEST_PY_BD: "qemu_mipsel" | |
267 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
268 | <<: *buildman_and_testpy_dfn |
269 | ||
270 | qemu_mips64 test.py: | |
271 | tags: [ 'all' ] | |
272 | variables: | |
273 | TEST_PY_BD: "qemu_mips64" | |
274 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
275 | <<: *buildman_and_testpy_dfn |
276 | ||
277 | qemu_mips64el test.py: | |
278 | tags: [ 'all' ] | |
279 | variables: | |
280 | TEST_PY_BD: "qemu_mips64el" | |
281 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
282 | <<: *buildman_and_testpy_dfn |
283 | ||
d8533167 DS |
284 | qemu_malta test.py: |
285 | tags: [ 'all' ] | |
286 | variables: | |
287 | TEST_PY_BD: "malta" | |
288 | TEST_PY_TEST_SPEC: "not sleep and not efi" | |
289 | TEST_PY_ID: "--id qemu" | |
290 | <<: *buildman_and_testpy_dfn | |
291 | ||
292 | qemu_maltael test.py: | |
293 | tags: [ 'all' ] | |
294 | variables: | |
295 | TEST_PY_BD: "maltael" | |
296 | TEST_PY_TEST_SPEC: "not sleep and not efi" | |
297 | TEST_PY_ID: "--id qemu" | |
298 | <<: *buildman_and_testpy_dfn | |
299 | ||
300 | qemu_malta64 test.py: | |
301 | tags: [ 'all' ] | |
302 | variables: | |
303 | TEST_PY_BD: "malta64" | |
304 | TEST_PY_TEST_SPEC: "not sleep and not efi" | |
305 | TEST_PY_ID: "--id qemu" | |
306 | <<: *buildman_and_testpy_dfn | |
307 | ||
308 | qemu_malta64el test.py: | |
309 | tags: [ 'all' ] | |
310 | variables: | |
311 | TEST_PY_BD: "malta64el" | |
312 | TEST_PY_TEST_SPEC: "not sleep and not efi" | |
313 | TEST_PY_ID: "--id qemu" | |
314 | <<: *buildman_and_testpy_dfn | |
315 | ||
1a62a722 TR |
316 | qemu-ppce500 test.py: |
317 | tags: [ 'all' ] | |
318 | variables: | |
319 | TEST_PY_BD: "qemu-ppce500" | |
320 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
321 | <<: *buildman_and_testpy_dfn |
322 | ||
a379d330 BM |
323 | qemu-riscv32 test.py: |
324 | tags: [ 'all' ] | |
325 | variables: | |
326 | TEST_PY_BD: "qemu-riscv32" | |
327 | TEST_PY_TEST_SPEC: "not sleep" | |
a379d330 BM |
328 | <<: *buildman_and_testpy_dfn |
329 | ||
7298d82d TR |
330 | qemu-riscv64 test.py: |
331 | tags: [ 'all' ] | |
332 | variables: | |
333 | TEST_PY_BD: "qemu-riscv64" | |
334 | TEST_PY_TEST_SPEC: "not sleep" | |
49fb28a4 BM |
335 | <<: *buildman_and_testpy_dfn |
336 | ||
337 | qemu-riscv32_spl test.py: | |
338 | tags: [ 'all' ] | |
339 | variables: | |
340 | TEST_PY_BD: "qemu-riscv32_spl" | |
341 | TEST_PY_TEST_SPEC: "not sleep" | |
49fb28a4 BM |
342 | <<: *buildman_and_testpy_dfn |
343 | ||
344 | qemu-riscv64_spl test.py: | |
345 | tags: [ 'all' ] | |
346 | variables: | |
347 | TEST_PY_BD: "qemu-riscv64_spl" | |
348 | TEST_PY_TEST_SPEC: "not sleep" | |
7298d82d TR |
349 | <<: *buildman_and_testpy_dfn |
350 | ||
1a62a722 TR |
351 | qemu-x86 test.py: |
352 | tags: [ 'all' ] | |
353 | variables: | |
354 | TEST_PY_BD: "qemu-x86" | |
355 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
356 | <<: *buildman_and_testpy_dfn |
357 | ||
358 | qemu-x86_64 test.py: | |
359 | tags: [ 'all' ] | |
360 | variables: | |
361 | TEST_PY_BD: "qemu-x86_64" | |
362 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
363 | <<: *buildman_and_testpy_dfn |
364 | ||
0e125756 MV |
365 | r2dplus_i82557c test.py: |
366 | tags: [ 'all' ] | |
367 | variables: | |
368 | TEST_PY_BD: "r2dplus" | |
369 | TEST_PY_ID: "--id i82557c_qemu" | |
370 | <<: *buildman_and_testpy_dfn | |
371 | ||
372 | r2dplus_pcnet test.py: | |
373 | tags: [ 'all' ] | |
374 | variables: | |
375 | TEST_PY_BD: "r2dplus" | |
376 | TEST_PY_ID: "--id pcnet_qemu" | |
377 | <<: *buildman_and_testpy_dfn | |
378 | ||
379 | r2dplus_rtl8139 test.py: | |
380 | tags: [ 'all' ] | |
381 | variables: | |
382 | TEST_PY_BD: "r2dplus" | |
383 | TEST_PY_ID: "--id rtl8139_qemu" | |
384 | <<: *buildman_and_testpy_dfn | |
385 | ||
386 | r2dplus_tulip test.py: | |
387 | tags: [ 'all' ] | |
388 | variables: | |
389 | TEST_PY_BD: "r2dplus" | |
390 | TEST_PY_ID: "--id tulip_qemu" | |
391 | <<: *buildman_and_testpy_dfn | |
392 | ||
f7c6ee7f | 393 | xilinx_zynq_virt test.py: |
1a62a722 TR |
394 | tags: [ 'all' ] |
395 | variables: | |
f7c6ee7f | 396 | TEST_PY_BD: "xilinx_zynq_virt" |
1a62a722 | 397 | TEST_PY_TEST_SPEC: "not sleep" |
1a62a722 | 398 | TEST_PY_ID: "--id qemu" |
1a62a722 TR |
399 | <<: *buildman_and_testpy_dfn |
400 | ||
401 | xilinx_versal_virt test.py: | |
402 | tags: [ 'all' ] | |
403 | variables: | |
404 | TEST_PY_BD: "xilinx_versal_virt" | |
405 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 | 406 | TEST_PY_ID: "--id qemu" |
1a62a722 TR |
407 | <<: *buildman_and_testpy_dfn |
408 | ||
409 | xtfpga test.py: | |
410 | tags: [ 'all' ] | |
411 | variables: | |
412 | TEST_PY_BD: "xtfpga" | |
413 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 | 414 | TEST_PY_ID: "--id qemu" |
1a62a722 | 415 | <<: *buildman_and_testpy_dfn |