blob: c64911207f1d3add9bc68d85df7d66505b530761 [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 Glass3b16d072020-03-18 09:42:54 -060041 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060042 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W
Simon Glass28d83e72020-03-18 09:42:55 -060043 --board ${TEST_PY_BD} ${OVERRIDE} || ret=$?;
Simon Glassda499352020-03-18 09:42:57 -060044 if [[ $ret -ne 0 ]]; then
Simon Glass28d83e72020-03-18 09:42:55 -060045 tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -se
46 --board ${TEST_PY_BD};
Simon Glass3b16d072020-03-18 09:42:54 -060047 exit $ret;
Tom Rinid2244b92019-06-19 09:25:17 -040048 fi
Tom Riniebcd2142019-10-24 11:59:27 -040049 - virtualenv -p /usr/bin/python3 /tmp/venv
50 - . /tmp/venv/bin/activate
51 - pip install -r test/py/requirements.txt
Simon Glass2600f7e2020-03-18 09:42:56 -060052 # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
Simon Glass28d83e72020-03-18 09:42:55 -060053 - export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH};
Tom Rinid2244b92019-06-19 09:25:17 -040054 export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci;
Simon Glass3b16d072020-03-18 09:42:54 -060055 ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
Simon Glass2600f7e2020-03-18 09:42:56 -060056 ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
Simon Glassfd0c59b2020-03-18 09:42:59 -060057 --build-dir "$UBOOT_TRAVIS_BUILD_DIR"
Tom Rinid2244b92019-06-19 09:25:17 -040058
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020059build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040060 tags: [ 'all' ]
61 stage: world build
62 script:
63 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060064 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
65 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060066 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040067 exit $ret;
68 fi;
Tom Rini372c6972019-07-17 17:51:28 -040069
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020070build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040071 tags: [ 'all' ]
72 stage: world build
73 script:
Tom Rini6c883102020-02-11 12:41:14 -050074 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rini7faea832019-07-18 07:28:36 -040075 - . /tmp/venv/bin/activate
76 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040077 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060078 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
79 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060080 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040081 exit $ret;
82 fi;
Tom Rini372c6972019-07-17 17:51:28 -040083
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020084build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040085 tags: [ 'all' ]
86 stage: world build
87 script:
88 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060089 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
90 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060091 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040092 exit $ret;
93 fi;
Tom Rini372c6972019-07-17 17:51:28 -040094
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020095build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -040096 tags: [ 'all' ]
97 stage: world build
98 script:
99 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -0600100 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
101 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -0600102 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -0400103 exit $ret;
104 fi;
Tom Rinid2244b92019-06-19 09:25:17 -0400105
106# QA jobs for code analytics
107# static code analysis with cppcheck (we can add --enable=all later)
108cppcheck:
109 tags: [ 'all' ]
110 stage: testsuites
111 script:
112 - cppcheck --force --quiet --inline-suppr .
113
114# search for TODO within source tree
115grep TODO/FIXME/HACK:
116 tags: [ 'all' ]
117 stage: testsuites
118 script:
119 - grep -r TODO .
120 - grep -r FIXME .
121 # search for HACK within source tree and ignore HACKKIT board
122 - grep -r HACK . | grep -v HACKKIT
123
Heinrich Schuchardtbccdb652020-02-21 18:24:01 +0100124# build HTML documentation
125htmldocs:
126 tags: [ 'all' ]
127 stage: testsuites
128 script:
129 - make htmldocs
130
Tom Rinid2244b92019-06-19 09:25:17 -0400131# some statistics about the code base
132sloccount:
133 tags: [ 'all' ]
134 stage: testsuites
135 script:
136 - sloccount .
137
138# ensure all configs have MAINTAINERS entries
139Check for configs without MAINTAINERS entry:
140 tags: [ 'all' ]
141 stage: testsuites
142 script:
143 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
144
145# Ensure host tools build
146Build tools-only:
147 tags: [ 'all' ]
148 stage: testsuites
149 script:
150 - make tools-only_config tools-only -j$(nproc)
151
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200152# Ensure env tools build
153Build envtools:
154 tags: [ 'all' ]
155 stage: testsuites
156 script:
157 - make tools-only_config envtools -j$(nproc)
158
Tom Rini0b3e0c42020-03-11 18:11:15 -0400159Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400160 tags: [ 'all' ]
161 stage: testsuites
162 script:
Tom Rini0b6e1032019-08-12 10:09:08 -0400163 - git config --global user.name "GitLab CI Runner";
164 git config --global user.email trini@konsulko.com;
165 export USER=gitlab;
Tom Rini6c883102020-02-11 12:41:14 -0500166 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rini0b6e1032019-08-12 10:09:08 -0400167 . /tmp/venv/bin/activate;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400168 pip install pyelftools pytest;
Simon Glass9e589c02020-03-18 09:42:50 -0600169 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400170 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
171 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass9e589c02020-03-18 09:42:50 -0600172 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400173 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
174 ./tools/buildman/buildman -t;
175 ./tools/dtoc/dtoc -t;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400176 ./tools/patman/patman --test;
177 make testconfig
Tom Rinid2244b92019-06-19 09:25:17 -0400178
179# Test sandbox with test.py
180sandbox test.py:
181 tags: [ 'all' ]
182 variables:
183 TEST_PY_BD: "sandbox"
Tom Rinid2244b92019-06-19 09:25:17 -0400184 <<: *buildman_and_testpy_dfn
185
Tom Rini99a1bb32019-11-06 19:30:47 -0500186sandbox with clang test.py:
187 tags: [ 'all' ]
188 variables:
189 TEST_PY_BD: "sandbox"
Tom Rini99a1bb32019-11-06 19:30:47 -0500190 OVERRIDE: "-O clang-7"
191 <<: *buildman_and_testpy_dfn
192
Tom Rinid2244b92019-06-19 09:25:17 -0400193sandbox_spl test.py:
194 tags: [ 'all' ]
195 variables:
196 TEST_PY_BD: "sandbox_spl"
Simon Glass132a9bf2020-03-18 09:42:58 -0600197 TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff"
Tom Rinid2244b92019-06-19 09:25:17 -0400198 <<: *buildman_and_testpy_dfn
199
Tom Rini0008b882019-07-17 16:06:57 -0400200evb-ast2500 test.py:
201 tags: [ 'all' ]
202 variables:
203 TEST_PY_BD: "evb-ast2500"
204 TEST_PY_ID: "--id qemu"
Tom Rini0008b882019-07-17 16:06:57 -0400205 <<: *buildman_and_testpy_dfn
206
Tom Rinid2244b92019-06-19 09:25:17 -0400207sandbox_flattree test.py:
208 tags: [ 'all' ]
209 variables:
210 TEST_PY_BD: "sandbox_flattree"
Tom Rinid2244b92019-06-19 09:25:17 -0400211 <<: *buildman_and_testpy_dfn
212
213vexpress_ca15_tc2 test.py:
214 tags: [ 'all' ]
215 variables:
216 TEST_PY_BD: "vexpress_ca15_tc2"
217 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400218 <<: *buildman_and_testpy_dfn
219
220vexpress_ca9x4 test.py:
221 tags: [ 'all' ]
222 variables:
223 TEST_PY_BD: "vexpress_ca9x4"
224 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400225 <<: *buildman_and_testpy_dfn
226
227integratorcp_cm926ejs test.py:
228 tags: [ 'all' ]
229 variables:
230 TEST_PY_BD: "integratorcp_cm926ejs"
231 TEST_PY_TEST_SPEC: "not sleep"
232 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400233 <<: *buildman_and_testpy_dfn
234
235qemu_arm test.py:
236 tags: [ 'all' ]
237 variables:
238 TEST_PY_BD: "qemu_arm"
239 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400240 <<: *buildman_and_testpy_dfn
241
242qemu_arm64 test.py:
243 tags: [ 'all' ]
244 variables:
245 TEST_PY_BD: "qemu_arm64"
246 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400247 <<: *buildman_and_testpy_dfn
248
249qemu_mips test.py:
250 tags: [ 'all' ]
251 variables:
252 TEST_PY_BD: "qemu_mips"
253 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400254 <<: *buildman_and_testpy_dfn
255
256qemu_mipsel test.py:
257 tags: [ 'all' ]
258 variables:
259 TEST_PY_BD: "qemu_mipsel"
260 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400261 <<: *buildman_and_testpy_dfn
262
263qemu_mips64 test.py:
264 tags: [ 'all' ]
265 variables:
266 TEST_PY_BD: "qemu_mips64"
267 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400268 <<: *buildman_and_testpy_dfn
269
270qemu_mips64el test.py:
271 tags: [ 'all' ]
272 variables:
273 TEST_PY_BD: "qemu_mips64el"
274 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400275 <<: *buildman_and_testpy_dfn
276
277qemu-ppce500 test.py:
278 tags: [ 'all' ]
279 variables:
280 TEST_PY_BD: "qemu-ppce500"
281 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400282 <<: *buildman_and_testpy_dfn
283
Bin Mengaeb3ea42020-03-28 07:25:27 -0700284qemu-riscv32 test.py:
285 tags: [ 'all' ]
286 variables:
287 TEST_PY_BD: "qemu-riscv32"
288 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengaeb3ea42020-03-28 07:25:27 -0700289 <<: *buildman_and_testpy_dfn
290
Tom Rinic8c320e2019-08-02 11:32:37 -0400291qemu-riscv64 test.py:
292 tags: [ 'all' ]
293 variables:
294 TEST_PY_BD: "qemu-riscv64"
295 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinic8c320e2019-08-02 11:32:37 -0400296 <<: *buildman_and_testpy_dfn
297
Bin Mengb68d9d62020-03-28 07:25:29 -0700298qemu-riscv32_spl test.py:
299 tags: [ 'all' ]
300 variables:
301 TEST_PY_BD: "qemu-riscv32_spl"
302 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700303 <<: *buildman_and_testpy_dfn
304
305qemu-riscv64_spl test.py:
306 tags: [ 'all' ]
307 variables:
308 TEST_PY_BD: "qemu-riscv64_spl"
309 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700310 <<: *buildman_and_testpy_dfn
311
Tom Rinid2244b92019-06-19 09:25:17 -0400312qemu-x86 test.py:
313 tags: [ 'all' ]
314 variables:
315 TEST_PY_BD: "qemu-x86"
316 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400317 <<: *buildman_and_testpy_dfn
318
319qemu-x86_64 test.py:
320 tags: [ 'all' ]
321 variables:
322 TEST_PY_BD: "qemu-x86_64"
323 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400324 <<: *buildman_and_testpy_dfn
325
Michal Simekf8834fd2020-02-13 15:03:29 +0100326xilinx_zynq_virt test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400327 tags: [ 'all' ]
328 variables:
Michal Simekf8834fd2020-02-13 15:03:29 +0100329 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rinid2244b92019-06-19 09:25:17 -0400330 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400331 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400332 <<: *buildman_and_testpy_dfn
333
334xilinx_versal_virt test.py:
335 tags: [ 'all' ]
336 variables:
337 TEST_PY_BD: "xilinx_versal_virt"
338 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400339 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400340 <<: *buildman_and_testpy_dfn
341
342xtfpga test.py:
343 tags: [ 'all' ]
344 variables:
345 TEST_PY_BD: "xtfpga"
346 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400347 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400348 <<: *buildman_and_testpy_dfn