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