]>
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: | |
4 | # https://gitlab.denx.de/u-boot/gitlab-ci-runner | |
20bc19ab | 5 | image: trini/u-boot-gitlab-ci-runner:bionic-20200311-10Apr2020 |
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 | |
24df1b14 | 23 | - cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi |
a379d330 | 24 | - cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi |
24df1b14 HS |
25 | - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi |
26 | - cp /opt/grub/grubarm.efi ~/grub_arm.efi | |
49fb28a4 BM |
27 | - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then |
28 | wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv32-bin.tar.xz | tar -C /tmp -xJ; | |
29 | export OPENSBI=/tmp/opensbi-0.6-rv32-bin/platform/qemu/virt/firmware/fw_dynamic.bin; | |
30 | fi | |
31 | - if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then | |
32 | wget -O - https://github.com/riscv/opensbi/releases/download/v0.6/opensbi-0.6-rv64-bin.tar.xz | tar -C /tmp -xJ; | |
33 | export OPENSBI=/tmp/opensbi-0.6-rv64-bin/platform/qemu/virt/firmware/fw_dynamic.bin; | |
34 | fi | |
b29cb058 | 35 | |
1a62a722 | 36 | after_script: |
24df1b14 | 37 | - rm -rf /tmp/uboot-test-hooks /tmp/venv |
1a62a722 TR |
38 | script: |
39 | # From buildman, exit code 129 means warnings only. If we've been asked to | |
40 | # use clang only do one configuration. | |
4e32fed4 | 41 | - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD} |
5bd95d63 | 42 | - ret=0; |
4e32fed4 SG |
43 | tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E |
44 | --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?; | |
5bd95d63 | 45 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then |
4e32fed4 SG |
46 | tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -se |
47 | --board ${TEST_PY_BD}; | |
5bd95d63 | 48 | exit $ret; |
1a62a722 TR |
49 | fi |
50 | # "not a_test_which_does_not_exist" is a dummy -k parameter which will | |
51 | # never prevent any test from running. That way, we can always pass | |
52 | # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom | |
53 | # value. | |
085b8978 TR |
54 | - virtualenv -p /usr/bin/python3 /tmp/venv |
55 | - . /tmp/venv/bin/activate | |
56 | - pip install -r test/py/requirements.txt | |
4e32fed4 | 57 | - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH}; |
1a62a722 | 58 | export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; |
5bd95d63 SG |
59 | ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} |
60 | -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" | |
61 | --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; | |
62 | ret=$?; | |
63 | if [[ $ret -ne 0 ]]; then | |
64 | exit $ret; | |
65 | fi | |
1a62a722 | 66 | |
a11cb57d | 67 | build all 32bit ARM platforms: |
1a62a722 TR |
68 | tags: [ 'all' ] |
69 | stage: world build | |
70 | script: | |
71 | - ret=0; | |
4c749971 TR |
72 | ./tools/buildman/buildman -o /tmp -P -E arm -x aarch64 || ret=$?; |
73 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then | |
b52f5a19 | 74 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
75 | exit $ret; |
76 | fi; | |
9f7bda10 | 77 | |
a11cb57d | 78 | build all 64bit ARM platforms: |
9f7bda10 TR |
79 | tags: [ 'all' ] |
80 | stage: world build | |
81 | script: | |
26a426a1 | 82 | - virtualenv -p /usr/bin/python3 /tmp/venv |
f0db8395 TR |
83 | - . /tmp/venv/bin/activate |
84 | - pip install pyelftools | |
9f7bda10 | 85 | - ret=0; |
4c749971 TR |
86 | ./tools/buildman/buildman -o /tmp -P -E aarch64 || ret=$?; |
87 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then | |
b52f5a19 | 88 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
89 | exit $ret; |
90 | fi; | |
9f7bda10 | 91 | |
a11cb57d | 92 | build all PowerPC platforms: |
9f7bda10 TR |
93 | tags: [ 'all' ] |
94 | stage: world build | |
95 | script: | |
96 | - ret=0; | |
4c749971 TR |
97 | ./tools/buildman/buildman -o /tmp -P -E powerpc || ret=$?; |
98 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then | |
b52f5a19 | 99 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
100 | exit $ret; |
101 | fi; | |
9f7bda10 | 102 | |
a11cb57d | 103 | build all other platforms: |
9f7bda10 TR |
104 | tags: [ 'all' ] |
105 | stage: world build | |
106 | script: | |
107 | - ret=0; | |
4c749971 TR |
108 | ./tools/buildman/buildman -o /tmp -P -E -x arm,powerpc || ret=$?; |
109 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then | |
b52f5a19 | 110 | ./tools/buildman/buildman -o /tmp -seP; |
4c749971 TR |
111 | exit $ret; |
112 | fi; | |
1a62a722 TR |
113 | |
114 | # QA jobs for code analytics | |
115 | # static code analysis with cppcheck (we can add --enable=all later) | |
116 | cppcheck: | |
117 | tags: [ 'all' ] | |
118 | stage: testsuites | |
119 | script: | |
120 | - cppcheck --force --quiet --inline-suppr . | |
121 | ||
122 | # search for TODO within source tree | |
123 | grep TODO/FIXME/HACK: | |
124 | tags: [ 'all' ] | |
125 | stage: testsuites | |
126 | script: | |
127 | - grep -r TODO . | |
128 | - grep -r FIXME . | |
129 | # search for HACK within source tree and ignore HACKKIT board | |
130 | - grep -r HACK . | grep -v HACKKIT | |
131 | ||
3eb7b78b HS |
132 | # build HTML documentation |
133 | htmldocs: | |
134 | tags: [ 'all' ] | |
135 | stage: testsuites | |
136 | script: | |
137 | - make htmldocs | |
138 | ||
1a62a722 TR |
139 | # some statistics about the code base |
140 | sloccount: | |
141 | tags: [ 'all' ] | |
142 | stage: testsuites | |
143 | script: | |
144 | - sloccount . | |
145 | ||
146 | # ensure all configs have MAINTAINERS entries | |
147 | Check for configs without MAINTAINERS entry: | |
148 | tags: [ 'all' ] | |
149 | stage: testsuites | |
150 | script: | |
151 | - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi | |
152 | ||
153 | # Ensure host tools build | |
154 | Build tools-only: | |
155 | tags: [ 'all' ] | |
156 | stage: testsuites | |
157 | script: | |
158 | - make tools-only_config tools-only -j$(nproc) | |
159 | ||
1f3910da PJT |
160 | # Ensure env tools build |
161 | Build envtools: | |
162 | tags: [ 'all' ] | |
163 | stage: testsuites | |
164 | script: | |
165 | - make tools-only_config envtools -j$(nproc) | |
166 | ||
7261833f | 167 | Run binman, buildman, dtoc, Kconfig and patman testsuites: |
1a62a722 TR |
168 | tags: [ 'all' ] |
169 | stage: testsuites | |
170 | script: | |
d7ae9321 TR |
171 | - git config --global user.name "GitLab CI Runner"; |
172 | git config --global user.email [email protected]; | |
173 | export USER=gitlab; | |
26a426a1 | 174 | virtualenv -p /usr/bin/python3 /tmp/venv; |
d7ae9321 | 175 | . /tmp/venv/bin/activate; |
7261833f | 176 | pip install pyelftools pytest; |
bf0a8133 | 177 | export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl; |
d7ae9321 TR |
178 | export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"; |
179 | export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"; | |
bf0a8133 | 180 | ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl; |
d7ae9321 TR |
181 | ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test; |
182 | ./tools/buildman/buildman -t; | |
183 | ./tools/dtoc/dtoc -t; | |
7261833f TR |
184 | ./tools/patman/patman --test; |
185 | make testconfig | |
1a62a722 TR |
186 | |
187 | # Test sandbox with test.py | |
188 | sandbox test.py: | |
189 | tags: [ 'all' ] | |
190 | variables: | |
191 | TEST_PY_BD: "sandbox" | |
1a62a722 TR |
192 | <<: *buildman_and_testpy_dfn |
193 | ||
0219d014 TR |
194 | sandbox with clang test.py: |
195 | tags: [ 'all' ] | |
196 | variables: | |
197 | TEST_PY_BD: "sandbox" | |
0219d014 TR |
198 | OVERRIDE: "-O clang-7" |
199 | <<: *buildman_and_testpy_dfn | |
200 | ||
1a62a722 TR |
201 | sandbox_spl test.py: |
202 | tags: [ 'all' ] | |
203 | variables: | |
204 | TEST_PY_BD: "sandbox_spl" | |
1a62a722 TR |
205 | TEST_PY_TEST_SPEC: "test_ofplatdata" |
206 | <<: *buildman_and_testpy_dfn | |
207 | ||
699c0b93 TR |
208 | evb-ast2500 test.py: |
209 | tags: [ 'all' ] | |
210 | variables: | |
211 | TEST_PY_BD: "evb-ast2500" | |
212 | TEST_PY_ID: "--id qemu" | |
699c0b93 TR |
213 | <<: *buildman_and_testpy_dfn |
214 | ||
1a62a722 TR |
215 | sandbox_flattree test.py: |
216 | tags: [ 'all' ] | |
217 | variables: | |
218 | TEST_PY_BD: "sandbox_flattree" | |
1a62a722 TR |
219 | <<: *buildman_and_testpy_dfn |
220 | ||
221 | vexpress_ca15_tc2 test.py: | |
222 | tags: [ 'all' ] | |
223 | variables: | |
224 | TEST_PY_BD: "vexpress_ca15_tc2" | |
225 | TEST_PY_ID: "--id qemu" | |
1a62a722 TR |
226 | <<: *buildman_and_testpy_dfn |
227 | ||
228 | vexpress_ca9x4 test.py: | |
229 | tags: [ 'all' ] | |
230 | variables: | |
231 | TEST_PY_BD: "vexpress_ca9x4" | |
232 | TEST_PY_ID: "--id qemu" | |
1a62a722 TR |
233 | <<: *buildman_and_testpy_dfn |
234 | ||
235 | integratorcp_cm926ejs test.py: | |
236 | tags: [ 'all' ] | |
237 | variables: | |
238 | TEST_PY_BD: "integratorcp_cm926ejs" | |
239 | TEST_PY_TEST_SPEC: "not sleep" | |
240 | TEST_PY_ID: "--id qemu" | |
1a62a722 TR |
241 | <<: *buildman_and_testpy_dfn |
242 | ||
243 | qemu_arm test.py: | |
244 | tags: [ 'all' ] | |
245 | variables: | |
246 | TEST_PY_BD: "qemu_arm" | |
247 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
248 | <<: *buildman_and_testpy_dfn |
249 | ||
250 | qemu_arm64 test.py: | |
251 | tags: [ 'all' ] | |
252 | variables: | |
253 | TEST_PY_BD: "qemu_arm64" | |
254 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
255 | <<: *buildman_and_testpy_dfn |
256 | ||
257 | qemu_mips test.py: | |
258 | tags: [ 'all' ] | |
259 | variables: | |
260 | TEST_PY_BD: "qemu_mips" | |
261 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
262 | <<: *buildman_and_testpy_dfn |
263 | ||
264 | qemu_mipsel test.py: | |
265 | tags: [ 'all' ] | |
266 | variables: | |
267 | TEST_PY_BD: "qemu_mipsel" | |
268 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
269 | <<: *buildman_and_testpy_dfn |
270 | ||
271 | qemu_mips64 test.py: | |
272 | tags: [ 'all' ] | |
273 | variables: | |
274 | TEST_PY_BD: "qemu_mips64" | |
275 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
276 | <<: *buildman_and_testpy_dfn |
277 | ||
278 | qemu_mips64el test.py: | |
279 | tags: [ 'all' ] | |
280 | variables: | |
281 | TEST_PY_BD: "qemu_mips64el" | |
282 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
283 | <<: *buildman_and_testpy_dfn |
284 | ||
285 | qemu-ppce500 test.py: | |
286 | tags: [ 'all' ] | |
287 | variables: | |
288 | TEST_PY_BD: "qemu-ppce500" | |
289 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
290 | <<: *buildman_and_testpy_dfn |
291 | ||
a379d330 BM |
292 | qemu-riscv32 test.py: |
293 | tags: [ 'all' ] | |
294 | variables: | |
295 | TEST_PY_BD: "qemu-riscv32" | |
296 | TEST_PY_TEST_SPEC: "not sleep" | |
a379d330 BM |
297 | <<: *buildman_and_testpy_dfn |
298 | ||
7298d82d TR |
299 | qemu-riscv64 test.py: |
300 | tags: [ 'all' ] | |
301 | variables: | |
302 | TEST_PY_BD: "qemu-riscv64" | |
303 | TEST_PY_TEST_SPEC: "not sleep" | |
49fb28a4 BM |
304 | <<: *buildman_and_testpy_dfn |
305 | ||
306 | qemu-riscv32_spl test.py: | |
307 | tags: [ 'all' ] | |
308 | variables: | |
309 | TEST_PY_BD: "qemu-riscv32_spl" | |
310 | TEST_PY_TEST_SPEC: "not sleep" | |
49fb28a4 BM |
311 | <<: *buildman_and_testpy_dfn |
312 | ||
313 | qemu-riscv64_spl test.py: | |
314 | tags: [ 'all' ] | |
315 | variables: | |
316 | TEST_PY_BD: "qemu-riscv64_spl" | |
317 | TEST_PY_TEST_SPEC: "not sleep" | |
7298d82d TR |
318 | <<: *buildman_and_testpy_dfn |
319 | ||
1a62a722 TR |
320 | qemu-x86 test.py: |
321 | tags: [ 'all' ] | |
322 | variables: | |
323 | TEST_PY_BD: "qemu-x86" | |
324 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
325 | <<: *buildman_and_testpy_dfn |
326 | ||
327 | qemu-x86_64 test.py: | |
328 | tags: [ 'all' ] | |
329 | variables: | |
330 | TEST_PY_BD: "qemu-x86_64" | |
331 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 TR |
332 | <<: *buildman_and_testpy_dfn |
333 | ||
f7c6ee7f | 334 | xilinx_zynq_virt test.py: |
1a62a722 TR |
335 | tags: [ 'all' ] |
336 | variables: | |
f7c6ee7f | 337 | TEST_PY_BD: "xilinx_zynq_virt" |
1a62a722 | 338 | TEST_PY_TEST_SPEC: "not sleep" |
1a62a722 | 339 | TEST_PY_ID: "--id qemu" |
1a62a722 TR |
340 | <<: *buildman_and_testpy_dfn |
341 | ||
342 | xilinx_versal_virt test.py: | |
343 | tags: [ 'all' ] | |
344 | variables: | |
345 | TEST_PY_BD: "xilinx_versal_virt" | |
346 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 | 347 | TEST_PY_ID: "--id qemu" |
1a62a722 TR |
348 | <<: *buildman_and_testpy_dfn |
349 | ||
350 | xtfpga test.py: | |
351 | tags: [ 'all' ] | |
352 | variables: | |
353 | TEST_PY_BD: "xtfpga" | |
354 | TEST_PY_TEST_SPEC: "not sleep" | |
1a62a722 | 355 | TEST_PY_ID: "--id qemu" |
1a62a722 | 356 | <<: *buildman_and_testpy_dfn |