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