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