blob: a4f8a719918b35b04d3b89dae80da8e0cbef7f58 [file] [log] [blame]
Tom Rinid2244b92019-06-19 09:25:17 -04001# 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
Tom Rini3c396bc2020-04-10 15:53:01 -04005image: trini/u-boot-gitlab-ci-runner:bionic-20200311-10Apr2020
Tom Rinid2244b92019-06-19 09:25:17 -04006
7# We run some tests in different order, to catch some failures quicker.
8stages:
Tom Rinid2244b92019-06-19 09:25:17 -04009 - testsuites
Tom Rini1cdb1822019-07-24 13:09:31 -040010 - test.py
Tom Rinid2244b92019-06-19 09:25:17 -040011 - 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`
Tom Rini6ad26042019-10-04 12:12:54 -040021 - 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
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010023 - cp /opt/grub/grubriscv64.efi ~/grub_riscv64.efi
Bin Mengaeb3ea42020-03-28 07:25:27 -070024 - cp /opt/grub/grubriscv32.efi ~/grub_riscv32.efi
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010025 - cp /opt/grub/grubaa64.efi ~/grub_arm64.efi
26 - cp /opt/grub/grubarm.efi ~/grub_arm.efi
Bin Mengb68d9d62020-03-28 07:25:29 -070027 - 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
Tom Rini1cdb1822019-07-24 13:09:31 -040035
Tom Rinid2244b92019-06-19 09:25:17 -040036 after_script:
Heinrich Schuchardt159b0ab2019-12-19 13:30:32 +010037 - rm -rf /tmp/uboot-test-hooks /tmp/venv
Tom Rinid2244b92019-06-19 09:25:17 -040038 script:
Simon Glassda499352020-03-18 09:42:57 -060039 # If we've been asked to use clang only do one configuration.
Simon Glass28d83e72020-03-18 09:42:55 -060040 - export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}
Simon Glass87c80462020-03-18 09:43:00 -060041 - tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
42 --board ${TEST_PY_BD} ${OVERRIDE}
Tom Riniebcd2142019-10-24 11:59:27 -040043 - virtualenv -p /usr/bin/python3 /tmp/venv
44 - . /tmp/venv/bin/activate
45 - pip install -r test/py/requirements.txt
Simon Glass2600f7e2020-03-18 09:42:56 -060046 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
Simon Glass28d83e72020-03-18 09:42:55 -060047 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rinid2244b92019-06-19 09:25:17 -040048 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Simon Glass3b16d072020-03-18 09:42:54 -060049 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
Simon Glass2600f7e2020-03-18 09:42:56 -060050 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
Simon Glassfd0c59b2020-03-18 09:42:59 -060051 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
Tom Rinid2244b92019-06-19 09:25:17 -040052
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020053build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040054 tags: [ 'all' ]
55 stage: world build
56 script:
57 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060058 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
59 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060060 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040061 exit $ret;
62 fi;
Tom Rini372c6972019-07-17 17:51:28 -040063
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020064build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040065 tags: [ 'all' ]
66 stage: world build
67 script:
Tom Rini6c883102020-02-11 12:41:14 -050068 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rini7faea832019-07-18 07:28:36 -040069 - . /tmp/venv/bin/activate
70 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040071 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060072 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
73 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060074 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040075 exit $ret;
76 fi;
Tom Rini372c6972019-07-17 17:51:28 -040077
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020078build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040079 tags: [ 'all' ]
80 stage: world build
81 script:
82 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060083 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
84 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060085 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040086 exit $ret;
87 fi;
Tom Rini372c6972019-07-17 17:51:28 -040088
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020089build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -040090 tags: [ 'all' ]
91 stage: world build
92 script:
93 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060094 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
95 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060096 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040097 exit $ret;
98 fi;
Tom Rinid2244b92019-06-19 09:25:17 -040099
100# QA jobs for code analytics
101# static code analysis with cppcheck (we can add --enable=all later)
102cppcheck:
103 tags: [ 'all' ]
104 stage: testsuites
105 script:
106 - cppcheck --force --quiet --inline-suppr .
107
108# search for TODO within source tree
109grep TODO/FIXME/HACK:
110 tags: [ 'all' ]
111 stage: testsuites
112 script:
113 - grep -r TODO .
114 - grep -r FIXME .
115 # search for HACK within source tree and ignore HACKKIT board
116 - grep -r HACK . | grep -v HACKKIT
117
Heinrich Schuchardtbccdb652020-02-21 18:24:01 +0100118# build HTML documentation
119htmldocs:
120 tags: [ 'all' ]
121 stage: testsuites
122 script:
123 - make htmldocs
124
Tom Rinid2244b92019-06-19 09:25:17 -0400125# some statistics about the code base
126sloccount:
127 tags: [ 'all' ]
128 stage: testsuites
129 script:
130 - sloccount .
131
132# ensure all configs have MAINTAINERS entries
133Check for configs without MAINTAINERS entry:
134 tags: [ 'all' ]
135 stage: testsuites
136 script:
137 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
138
139# Ensure host tools build
140Build tools-only:
141 tags: [ 'all' ]
142 stage: testsuites
143 script:
144 - make tools-only_config tools-only -j$(nproc)
145
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200146# Ensure env tools build
147Build envtools:
148 tags: [ 'all' ]
149 stage: testsuites
150 script:
151 - make tools-only_config envtools -j$(nproc)
152
Tom Rini0b3e0c42020-03-11 18:11:15 -0400153Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400154 tags: [ 'all' ]
155 stage: testsuites
156 script:
Tom Rini0b6e1032019-08-12 10:09:08 -0400157 - git config --global user.name "GitLab CI Runner";
158 git config --global user.email trini@konsulko.com;
159 export USER=gitlab;
Tom Rini6c883102020-02-11 12:41:14 -0500160 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rini0b6e1032019-08-12 10:09:08 -0400161 . /tmp/venv/bin/activate;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400162 pip install pyelftools pytest;
Simon Glass9e589c02020-03-18 09:42:50 -0600163 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400164 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
165 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass9e589c02020-03-18 09:42:50 -0600166 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400167 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
168 ./tools/buildman/buildman -t;
169 ./tools/dtoc/dtoc -t;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400170 ./tools/patman/patman --test;
171 make testconfig
Tom Rinid2244b92019-06-19 09:25:17 -0400172
173# Test sandbox with test.py
174sandbox test.py:
175 tags: [ 'all' ]
176 variables:
177 TEST_PY_BD: "sandbox"
Tom Rinid2244b92019-06-19 09:25:17 -0400178 <<: *buildman_and_testpy_dfn
179
Tom Rini99a1bb32019-11-06 19:30:47 -0500180sandbox with clang test.py:
181 tags: [ 'all' ]
182 variables:
183 TEST_PY_BD: "sandbox"
Tom Rini99a1bb32019-11-06 19:30:47 -0500184 OVERRIDE: "-O clang-7"
185 <<: *buildman_and_testpy_dfn
186
Tom Rinid2244b92019-06-19 09:25:17 -0400187sandbox_spl test.py:
188 tags: [ 'all' ]
189 variables:
190 TEST_PY_BD: "sandbox_spl"
Simon Glass132a9bf2020-03-18 09:42:58 -0600191 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
Tom Rinid2244b92019-06-19 09:25:17 -0400192 <<: *buildman_and_testpy_dfn
193
Tom Rini0008b882019-07-17 16:06:57 -0400194evb-ast2500 test.py:
195 tags: [ 'all' ]
196 variables:
197 TEST_PY_BD: "evb-ast2500"
198 TEST_PY_ID: "--id qemu"
Tom Rini0008b882019-07-17 16:06:57 -0400199 <<: *buildman_and_testpy_dfn
200
Tom Rinid2244b92019-06-19 09:25:17 -0400201sandbox_flattree test.py:
202 tags: [ 'all' ]
203 variables:
204 TEST_PY_BD: "sandbox_flattree"
Tom Rinid2244b92019-06-19 09:25:17 -0400205 <<: *buildman_and_testpy_dfn
206
207vexpress_ca15_tc2 test.py:
208 tags: [ 'all' ]
209 variables:
210 TEST_PY_BD: "vexpress_ca15_tc2"
211 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400212 <<: *buildman_and_testpy_dfn
213
214vexpress_ca9x4 test.py:
215 tags: [ 'all' ]
216 variables:
217 TEST_PY_BD: "vexpress_ca9x4"
218 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400219 <<: *buildman_and_testpy_dfn
220
221integratorcp_cm926ejs test.py:
222 tags: [ 'all' ]
223 variables:
224 TEST_PY_BD: "integratorcp_cm926ejs"
225 TEST_PY_TEST_SPEC: "not sleep"
226 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400227 <<: *buildman_and_testpy_dfn
228
229qemu_arm test.py:
230 tags: [ 'all' ]
231 variables:
232 TEST_PY_BD: "qemu_arm"
233 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400234 <<: *buildman_and_testpy_dfn
235
236qemu_arm64 test.py:
237 tags: [ 'all' ]
238 variables:
239 TEST_PY_BD: "qemu_arm64"
240 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400241 <<: *buildman_and_testpy_dfn
242
243qemu_mips test.py:
244 tags: [ 'all' ]
245 variables:
246 TEST_PY_BD: "qemu_mips"
247 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400248 <<: *buildman_and_testpy_dfn
249
250qemu_mipsel test.py:
251 tags: [ 'all' ]
252 variables:
253 TEST_PY_BD: "qemu_mipsel"
254 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400255 <<: *buildman_and_testpy_dfn
256
257qemu_mips64 test.py:
258 tags: [ 'all' ]
259 variables:
260 TEST_PY_BD: "qemu_mips64"
261 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400262 <<: *buildman_and_testpy_dfn
263
264qemu_mips64el test.py:
265 tags: [ 'all' ]
266 variables:
267 TEST_PY_BD: "qemu_mips64el"
268 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400269 <<: *buildman_and_testpy_dfn
270
271qemu-ppce500 test.py:
272 tags: [ 'all' ]
273 variables:
274 TEST_PY_BD: "qemu-ppce500"
275 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400276 <<: *buildman_and_testpy_dfn
277
Bin Mengaeb3ea42020-03-28 07:25:27 -0700278qemu-riscv32 test.py:
279 tags: [ 'all' ]
280 variables:
281 TEST_PY_BD: "qemu-riscv32"
282 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengaeb3ea42020-03-28 07:25:27 -0700283 <<: *buildman_and_testpy_dfn
284
Tom Rinic8c320e2019-08-02 11:32:37 -0400285qemu-riscv64 test.py:
286 tags: [ 'all' ]
287 variables:
288 TEST_PY_BD: "qemu-riscv64"
289 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinic8c320e2019-08-02 11:32:37 -0400290 <<: *buildman_and_testpy_dfn
291
Bin Mengb68d9d62020-03-28 07:25:29 -0700292qemu-riscv32_spl test.py:
293 tags: [ 'all' ]
294 variables:
295 TEST_PY_BD: "qemu-riscv32_spl"
296 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700297 <<: *buildman_and_testpy_dfn
298
299qemu-riscv64_spl test.py:
300 tags: [ 'all' ]
301 variables:
302 TEST_PY_BD: "qemu-riscv64_spl"
303 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700304 <<: *buildman_and_testpy_dfn
305
Tom Rinid2244b92019-06-19 09:25:17 -0400306qemu-x86 test.py:
307 tags: [ 'all' ]
308 variables:
309 TEST_PY_BD: "qemu-x86"
310 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400311 <<: *buildman_and_testpy_dfn
312
313qemu-x86_64 test.py:
314 tags: [ 'all' ]
315 variables:
316 TEST_PY_BD: "qemu-x86_64"
317 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400318 <<: *buildman_and_testpy_dfn
319
Michal Simekf8834fd2020-02-13 15:03:29 +0100320xilinx_zynq_virt test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400321 tags: [ 'all' ]
322 variables:
Michal Simekf8834fd2020-02-13 15:03:29 +0100323 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rinid2244b92019-06-19 09:25:17 -0400324 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400325 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400326 <<: *buildman_and_testpy_dfn
327
328xilinx_versal_virt test.py:
329 tags: [ 'all' ]
330 variables:
331 TEST_PY_BD: "xilinx_versal_virt"
332 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400333 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400334 <<: *buildman_and_testpy_dfn
335
336xtfpga test.py:
337 tags: [ 'all' ]
338 variables:
339 TEST_PY_BD: "xtfpga"
340 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400341 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400342 <<: *buildman_and_testpy_dfn