]> Git Repo - J-u-boot.git/blame - .gitlab-ci.yml
test: Use positive conditional in test_matches()
[J-u-boot.git] / .gitlab-ci.yml
CommitLineData
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
71490773 5image: trini/u-boot-gitlab-ci-runner:bionic-20200807-02Sep2020
1a62a722
TR
6
7# We run some tests in different order, to catch some failures quicker.
8stages:
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
41 - cp /opt/grub/grubriscv32.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv32.efi
42 - cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
43 - cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
085b8978
TR
44 - virtualenv -p /usr/bin/python3 /tmp/venv
45 - . /tmp/venv/bin/activate
46 - pip install -r test/py/requirements.txt
4080d097 47 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
4e32fed4 48 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
1a62a722 49 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
f3092473 50 ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
4080d097 51 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
cec1e856 52 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
1a62a722 53
a11cb57d 54build all 32bit ARM platforms:
1a62a722
TR
55 stage: world build
56 script:
57 - ret=0;
dd5c954e
SG
58 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
59 if [[ $ret -ne 0 ]]; then
b52f5a19 60 ./tools/buildman/buildman -o /tmp -seP;
4c749971
TR
61 exit $ret;
62 fi;
9f7bda10 63
a11cb57d 64build all 64bit ARM platforms:
9f7bda10
TR
65 stage: world build
66 script:
26a426a1 67 - virtualenv -p /usr/bin/python3 /tmp/venv
f0db8395
TR
68 - . /tmp/venv/bin/activate
69 - pip install pyelftools
9f7bda10 70 - ret=0;
dd5c954e
SG
71 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
72 if [[ $ret -ne 0 ]]; then
b52f5a19 73 ./tools/buildman/buildman -o /tmp -seP;
4c749971
TR
74 exit $ret;
75 fi;
9f7bda10 76
a11cb57d 77build all PowerPC platforms:
9f7bda10
TR
78 stage: world build
79 script:
80 - ret=0;
dd5c954e
SG
81 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
82 if [[ $ret -ne 0 ]]; then
b52f5a19 83 ./tools/buildman/buildman -o /tmp -seP;
4c749971
TR
84 exit $ret;
85 fi;
9f7bda10 86
a11cb57d 87build all other platforms:
9f7bda10
TR
88 stage: world build
89 script:
90 - ret=0;
dd5c954e
SG
91 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
92 if [[ $ret -ne 0 ]]; then
b52f5a19 93 ./tools/buildman/buildman -o /tmp -seP;
4c749971
TR
94 exit $ret;
95 fi;
1a62a722
TR
96
97# QA jobs for code analytics
98# static code analysis with cppcheck (we can add --enable=all later)
99cppcheck:
1a62a722
TR
100 stage: testsuites
101 script:
4ee7f527 102 - cppcheck -j$(nproc) --force --quiet --inline-suppr .
1a62a722
TR
103
104# search for TODO within source tree
105grep TODO/FIXME/HACK:
1a62a722
TR
106 stage: testsuites
107 script:
108 - grep -r TODO .
109 - grep -r FIXME .
110 # search for HACK within source tree and ignore HACKKIT board
111 - grep -r HACK . | grep -v HACKKIT
112
3eb7b78b
HS
113# build HTML documentation
114htmldocs:
3eb7b78b
HS
115 stage: testsuites
116 script:
836049d6
HS
117 - virtualenv -p /usr/bin/python3 /tmp/venvhtml
118 - . /tmp/venvhtml/bin/activate
119 - pip install -r doc/sphinx/requirements.txt
3eb7b78b
HS
120 - make htmldocs
121
1a62a722
TR
122# some statistics about the code base
123sloccount:
1a62a722
TR
124 stage: testsuites
125 script:
126 - sloccount .
127
128# ensure all configs have MAINTAINERS entries
129Check for configs without MAINTAINERS entry:
1a62a722
TR
130 stage: testsuites
131 script:
132 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
133
134# Ensure host tools build
135Build tools-only:
1a62a722
TR
136 stage: testsuites
137 script:
138 - make tools-only_config tools-only -j$(nproc)
139
1f3910da
PJT
140# Ensure env tools build
141Build envtools:
1f3910da
PJT
142 stage: testsuites
143 script:
144 - make tools-only_config envtools -j$(nproc)
145
7261833f 146Run binman, buildman, dtoc, Kconfig and patman testsuites:
1a62a722
TR
147 stage: testsuites
148 script:
d7ae9321
TR
149 - git config --global user.name "GitLab CI Runner";
150 git config --global user.email [email protected];
151 export USER=gitlab;
26a426a1 152 virtualenv -p /usr/bin/python3 /tmp/venv;
d7ae9321 153 . /tmp/venv/bin/activate;
bd73bb44 154 pip install pyelftools pytest pygit2;
bf0a8133 155 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
d7ae9321
TR
156 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
157 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
6c914e42
SG
158 ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
159 --board sandbox_spl;
d7ae9321
TR
160 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
161 ./tools/buildman/buildman -t;
162 ./tools/dtoc/dtoc -t;
6bb74de7 163 ./tools/patman/patman test;
7261833f 164 make testconfig
1a62a722 165
6cfd09d4 166Run tests for Nokia RX-51 (aka N900):
6cfd09d4
T
167 stage: testsuites
168 script:
169 - ./tools/buildman/buildman --fetch-arch arm;
170 export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
171 test/nokia_rx51_test.sh
172
1a62a722
TR
173# Test sandbox with test.py
174sandbox test.py:
1a62a722
TR
175 variables:
176 TEST_PY_BD: "sandbox"
1a62a722
TR
177 <<: *buildman_and_testpy_dfn
178
0219d014 179sandbox with clang test.py:
0219d014
TR
180 variables:
181 TEST_PY_BD: "sandbox"
c8790bee 182 OVERRIDE: "-O clang-10"
0219d014
TR
183 <<: *buildman_and_testpy_dfn
184
1a62a722 185sandbox_spl test.py:
1a62a722
TR
186 variables:
187 TEST_PY_BD: "sandbox_spl"
afb26ba9 188 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
1a62a722
TR
189 <<: *buildman_and_testpy_dfn
190
6c914e42
SG
191sandbox_noinst_test.py:
192 tags: [ 'all' ]
193 variables:
194 TEST_PY_BD: "sandbox_noinst"
195 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
196 <<: *buildman_and_testpy_dfn
197
699c0b93 198evb-ast2500 test.py:
699c0b93
TR
199 variables:
200 TEST_PY_BD: "evb-ast2500"
201 TEST_PY_ID: "--id qemu"
699c0b93
TR
202 <<: *buildman_and_testpy_dfn
203
1a62a722 204sandbox_flattree test.py:
1a62a722
TR
205 variables:
206 TEST_PY_BD: "sandbox_flattree"
1a62a722
TR
207 <<: *buildman_and_testpy_dfn
208
1a62a722 209integratorcp_cm926ejs test.py:
1a62a722
TR
210 variables:
211 TEST_PY_BD: "integratorcp_cm926ejs"
212 TEST_PY_TEST_SPEC: "not sleep"
213 TEST_PY_ID: "--id qemu"
1a62a722
TR
214 <<: *buildman_and_testpy_dfn
215
216qemu_arm test.py:
1a62a722
TR
217 variables:
218 TEST_PY_BD: "qemu_arm"
219 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
220 <<: *buildman_and_testpy_dfn
221
222qemu_arm64 test.py:
1a62a722
TR
223 variables:
224 TEST_PY_BD: "qemu_arm64"
225 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
226 <<: *buildman_and_testpy_dfn
227
228qemu_mips test.py:
1a62a722
TR
229 variables:
230 TEST_PY_BD: "qemu_mips"
231 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
232 <<: *buildman_and_testpy_dfn
233
234qemu_mipsel test.py:
1a62a722
TR
235 variables:
236 TEST_PY_BD: "qemu_mipsel"
237 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
238 <<: *buildman_and_testpy_dfn
239
240qemu_mips64 test.py:
1a62a722
TR
241 variables:
242 TEST_PY_BD: "qemu_mips64"
243 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
244 <<: *buildman_and_testpy_dfn
245
246qemu_mips64el test.py:
1a62a722
TR
247 variables:
248 TEST_PY_BD: "qemu_mips64el"
249 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
250 <<: *buildman_and_testpy_dfn
251
d8533167 252qemu_malta test.py:
d8533167
DS
253 variables:
254 TEST_PY_BD: "malta"
255 TEST_PY_TEST_SPEC: "not sleep and not efi"
256 TEST_PY_ID: "--id qemu"
257 <<: *buildman_and_testpy_dfn
258
259qemu_maltael test.py:
d8533167
DS
260 variables:
261 TEST_PY_BD: "maltael"
262 TEST_PY_TEST_SPEC: "not sleep and not efi"
263 TEST_PY_ID: "--id qemu"
264 <<: *buildman_and_testpy_dfn
265
266qemu_malta64 test.py:
d8533167
DS
267 variables:
268 TEST_PY_BD: "malta64"
269 TEST_PY_TEST_SPEC: "not sleep and not efi"
270 TEST_PY_ID: "--id qemu"
271 <<: *buildman_and_testpy_dfn
272
273qemu_malta64el test.py:
d8533167
DS
274 variables:
275 TEST_PY_BD: "malta64el"
276 TEST_PY_TEST_SPEC: "not sleep and not efi"
277 TEST_PY_ID: "--id qemu"
278 <<: *buildman_and_testpy_dfn
279
1a62a722 280qemu-ppce500 test.py:
1a62a722
TR
281 variables:
282 TEST_PY_BD: "qemu-ppce500"
283 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
284 <<: *buildman_and_testpy_dfn
285
a379d330 286qemu-riscv32 test.py:
a379d330
BM
287 variables:
288 TEST_PY_BD: "qemu-riscv32"
289 TEST_PY_TEST_SPEC: "not sleep"
a379d330
BM
290 <<: *buildman_and_testpy_dfn
291
7298d82d 292qemu-riscv64 test.py:
7298d82d
TR
293 variables:
294 TEST_PY_BD: "qemu-riscv64"
295 TEST_PY_TEST_SPEC: "not sleep"
49fb28a4
BM
296 <<: *buildman_and_testpy_dfn
297
298qemu-riscv32_spl test.py:
49fb28a4
BM
299 variables:
300 TEST_PY_BD: "qemu-riscv32_spl"
301 TEST_PY_TEST_SPEC: "not sleep"
49fb28a4
BM
302 <<: *buildman_and_testpy_dfn
303
304qemu-riscv64_spl test.py:
49fb28a4
BM
305 variables:
306 TEST_PY_BD: "qemu-riscv64_spl"
307 TEST_PY_TEST_SPEC: "not sleep"
7298d82d
TR
308 <<: *buildman_and_testpy_dfn
309
1a62a722 310qemu-x86 test.py:
1a62a722
TR
311 variables:
312 TEST_PY_BD: "qemu-x86"
313 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
314 <<: *buildman_and_testpy_dfn
315
316qemu-x86_64 test.py:
1a62a722
TR
317 variables:
318 TEST_PY_BD: "qemu-x86_64"
319 TEST_PY_TEST_SPEC: "not sleep"
1a62a722
TR
320 <<: *buildman_and_testpy_dfn
321
0e125756 322r2dplus_i82557c test.py:
0e125756
MV
323 variables:
324 TEST_PY_BD: "r2dplus"
325 TEST_PY_ID: "--id i82557c_qemu"
326 <<: *buildman_and_testpy_dfn
327
328r2dplus_pcnet test.py:
0e125756
MV
329 variables:
330 TEST_PY_BD: "r2dplus"
331 TEST_PY_ID: "--id pcnet_qemu"
332 <<: *buildman_and_testpy_dfn
333
334r2dplus_rtl8139 test.py:
0e125756
MV
335 variables:
336 TEST_PY_BD: "r2dplus"
337 TEST_PY_ID: "--id rtl8139_qemu"
338 <<: *buildman_and_testpy_dfn
339
340r2dplus_tulip test.py:
0e125756
MV
341 variables:
342 TEST_PY_BD: "r2dplus"
343 TEST_PY_ID: "--id tulip_qemu"
344 <<: *buildman_and_testpy_dfn
345
f7c6ee7f 346xilinx_zynq_virt test.py:
1a62a722 347 variables:
f7c6ee7f 348 TEST_PY_BD: "xilinx_zynq_virt"
1a62a722 349 TEST_PY_TEST_SPEC: "not sleep"
1a62a722 350 TEST_PY_ID: "--id qemu"
1a62a722
TR
351 <<: *buildman_and_testpy_dfn
352
353xilinx_versal_virt test.py:
1a62a722
TR
354 variables:
355 TEST_PY_BD: "xilinx_versal_virt"
356 TEST_PY_TEST_SPEC: "not sleep"
1a62a722 357 TEST_PY_ID: "--id qemu"
1a62a722
TR
358 <<: *buildman_and_testpy_dfn
359
360xtfpga test.py:
1a62a722
TR
361 variables:
362 TEST_PY_BD: "xtfpga"
363 TEST_PY_TEST_SPEC: "not sleep"
1a62a722 364 TEST_PY_ID: "--id qemu"
1a62a722 365 <<: *buildman_and_testpy_dfn
This page took 0.119803 seconds and 4 git commands to generate.