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