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