blob: 87070858541df65b60e4c56c1e1b70aac6e786b8 [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 Glass3b16d072020-03-18 09:42:54 -060057 --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
58 ret=$?;
59 if [[ $ret -ne 0 ]]; then
60 exit $ret;
61 fi
Tom Rinid2244b92019-06-19 09:25:17 -040062
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020063build all 32bit ARM platforms:
Tom Rinid2244b92019-06-19 09:25:17 -040064 tags: [ 'all' ]
65 stage: world build
66 script:
67 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060068 ./tools/buildman/buildman -o /tmp -P -E -W arm -x aarch64 || ret=$?;
69 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060070 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040071 exit $ret;
72 fi;
Tom Rini372c6972019-07-17 17:51:28 -040073
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020074build all 64bit ARM platforms:
Tom Rini372c6972019-07-17 17:51:28 -040075 tags: [ 'all' ]
76 stage: world build
77 script:
Tom Rini6c883102020-02-11 12:41:14 -050078 - virtualenv -p /usr/bin/python3 /tmp/venv
Tom Rini7faea832019-07-18 07:28:36 -040079 - . /tmp/venv/bin/activate
80 - pip install pyelftools
Tom Rini372c6972019-07-17 17:51:28 -040081 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060082 ./tools/buildman/buildman -o /tmp -P -E -W aarch64 || ret=$?;
83 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060084 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040085 exit $ret;
86 fi;
Tom Rini372c6972019-07-17 17:51:28 -040087
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020088build all PowerPC platforms:
Tom Rini372c6972019-07-17 17:51:28 -040089 tags: [ 'all' ]
90 stage: world build
91 script:
92 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -060093 ./tools/buildman/buildman -o /tmp -P -E -W powerpc || ret=$?;
94 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -060095 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -040096 exit $ret;
97 fi;
Tom Rini372c6972019-07-17 17:51:28 -040098
Heinrich Schuchardt8e8e1cc2019-10-06 12:26:16 +020099build all other platforms:
Tom Rini372c6972019-07-17 17:51:28 -0400100 tags: [ 'all' ]
101 stage: world build
102 script:
103 - ret=0;
Simon Glassda499352020-03-18 09:42:57 -0600104 ./tools/buildman/buildman -o /tmp -P -E -W -x arm,powerpc || ret=$?;
105 if [[ $ret -ne 0 ]]; then
Simon Glassad8eaed2020-03-18 09:42:53 -0600106 ./tools/buildman/buildman -o /tmp -seP;
Tom Rini70c63a52019-10-24 11:59:16 -0400107 exit $ret;
108 fi;
Tom Rinid2244b92019-06-19 09:25:17 -0400109
110# QA jobs for code analytics
111# static code analysis with cppcheck (we can add --enable=all later)
112cppcheck:
113 tags: [ 'all' ]
114 stage: testsuites
115 script:
116 - cppcheck --force --quiet --inline-suppr .
117
118# search for TODO within source tree
119grep TODO/FIXME/HACK:
120 tags: [ 'all' ]
121 stage: testsuites
122 script:
123 - grep -r TODO .
124 - grep -r FIXME .
125 # search for HACK within source tree and ignore HACKKIT board
126 - grep -r HACK . | grep -v HACKKIT
127
Heinrich Schuchardtbccdb652020-02-21 18:24:01 +0100128# build HTML documentation
129htmldocs:
130 tags: [ 'all' ]
131 stage: testsuites
132 script:
133 - make htmldocs
134
Tom Rinid2244b92019-06-19 09:25:17 -0400135# some statistics about the code base
136sloccount:
137 tags: [ 'all' ]
138 stage: testsuites
139 script:
140 - sloccount .
141
142# ensure all configs have MAINTAINERS entries
143Check for configs without MAINTAINERS entry:
144 tags: [ 'all' ]
145 stage: testsuites
146 script:
147 - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi
148
149# Ensure host tools build
150Build tools-only:
151 tags: [ 'all' ]
152 stage: testsuites
153 script:
154 - make tools-only_config tools-only -j$(nproc)
155
Pierre-Jean Texier6812f5e2019-08-26 13:06:18 +0200156# Ensure env tools build
157Build envtools:
158 tags: [ 'all' ]
159 stage: testsuites
160 script:
161 - make tools-only_config envtools -j$(nproc)
162
Tom Rini0b3e0c42020-03-11 18:11:15 -0400163Run binman, buildman, dtoc, Kconfig and patman testsuites:
Tom Rinid2244b92019-06-19 09:25:17 -0400164 tags: [ 'all' ]
165 stage: testsuites
166 script:
Tom Rini0b6e1032019-08-12 10:09:08 -0400167 - git config --global user.name "GitLab CI Runner";
168 git config --global user.email trini@konsulko.com;
169 export USER=gitlab;
Tom Rini6c883102020-02-11 12:41:14 -0500170 virtualenv -p /usr/bin/python3 /tmp/venv;
Tom Rini0b6e1032019-08-12 10:09:08 -0400171 . /tmp/venv/bin/activate;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400172 pip install pyelftools pytest;
Simon Glass9e589c02020-03-18 09:42:50 -0600173 export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400174 export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
175 export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
Simon Glass9e589c02020-03-18 09:42:50 -0600176 ./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
Tom Rini0b6e1032019-08-12 10:09:08 -0400177 ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
178 ./tools/buildman/buildman -t;
179 ./tools/dtoc/dtoc -t;
Tom Rini0b3e0c42020-03-11 18:11:15 -0400180 ./tools/patman/patman --test;
181 make testconfig
Tom Rinid2244b92019-06-19 09:25:17 -0400182
183# Test sandbox with test.py
184sandbox test.py:
185 tags: [ 'all' ]
186 variables:
187 TEST_PY_BD: "sandbox"
Tom Rinid2244b92019-06-19 09:25:17 -0400188 <<: *buildman_and_testpy_dfn
189
Tom Rini99a1bb32019-11-06 19:30:47 -0500190sandbox with clang test.py:
191 tags: [ 'all' ]
192 variables:
193 TEST_PY_BD: "sandbox"
Tom Rini99a1bb32019-11-06 19:30:47 -0500194 OVERRIDE: "-O clang-7"
195 <<: *buildman_and_testpy_dfn
196
Tom Rinid2244b92019-06-19 09:25:17 -0400197sandbox_spl test.py:
198 tags: [ 'all' ]
199 variables:
200 TEST_PY_BD: "sandbox_spl"
Tom Rinid2244b92019-06-19 09:25:17 -0400201 TEST_PY_TEST_SPEC: "test_ofplatdata"
202 <<: *buildman_and_testpy_dfn
203
Tom Rini0008b882019-07-17 16:06:57 -0400204evb-ast2500 test.py:
205 tags: [ 'all' ]
206 variables:
207 TEST_PY_BD: "evb-ast2500"
208 TEST_PY_ID: "--id qemu"
Tom Rini0008b882019-07-17 16:06:57 -0400209 <<: *buildman_and_testpy_dfn
210
Tom Rinid2244b92019-06-19 09:25:17 -0400211sandbox_flattree test.py:
212 tags: [ 'all' ]
213 variables:
214 TEST_PY_BD: "sandbox_flattree"
Tom Rinid2244b92019-06-19 09:25:17 -0400215 <<: *buildman_and_testpy_dfn
216
217vexpress_ca15_tc2 test.py:
218 tags: [ 'all' ]
219 variables:
220 TEST_PY_BD: "vexpress_ca15_tc2"
221 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400222 <<: *buildman_and_testpy_dfn
223
224vexpress_ca9x4 test.py:
225 tags: [ 'all' ]
226 variables:
227 TEST_PY_BD: "vexpress_ca9x4"
228 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400229 <<: *buildman_and_testpy_dfn
230
231integratorcp_cm926ejs test.py:
232 tags: [ 'all' ]
233 variables:
234 TEST_PY_BD: "integratorcp_cm926ejs"
235 TEST_PY_TEST_SPEC: "not sleep"
236 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400237 <<: *buildman_and_testpy_dfn
238
239qemu_arm test.py:
240 tags: [ 'all' ]
241 variables:
242 TEST_PY_BD: "qemu_arm"
243 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400244 <<: *buildman_and_testpy_dfn
245
246qemu_arm64 test.py:
247 tags: [ 'all' ]
248 variables:
249 TEST_PY_BD: "qemu_arm64"
250 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400251 <<: *buildman_and_testpy_dfn
252
253qemu_mips test.py:
254 tags: [ 'all' ]
255 variables:
256 TEST_PY_BD: "qemu_mips"
257 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400258 <<: *buildman_and_testpy_dfn
259
260qemu_mipsel test.py:
261 tags: [ 'all' ]
262 variables:
263 TEST_PY_BD: "qemu_mipsel"
264 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400265 <<: *buildman_and_testpy_dfn
266
267qemu_mips64 test.py:
268 tags: [ 'all' ]
269 variables:
270 TEST_PY_BD: "qemu_mips64"
271 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400272 <<: *buildman_and_testpy_dfn
273
274qemu_mips64el test.py:
275 tags: [ 'all' ]
276 variables:
277 TEST_PY_BD: "qemu_mips64el"
278 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400279 <<: *buildman_and_testpy_dfn
280
281qemu-ppce500 test.py:
282 tags: [ 'all' ]
283 variables:
284 TEST_PY_BD: "qemu-ppce500"
285 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400286 <<: *buildman_and_testpy_dfn
287
Bin Mengaeb3ea42020-03-28 07:25:27 -0700288qemu-riscv32 test.py:
289 tags: [ 'all' ]
290 variables:
291 TEST_PY_BD: "qemu-riscv32"
292 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengaeb3ea42020-03-28 07:25:27 -0700293 <<: *buildman_and_testpy_dfn
294
Tom Rinic8c320e2019-08-02 11:32:37 -0400295qemu-riscv64 test.py:
296 tags: [ 'all' ]
297 variables:
298 TEST_PY_BD: "qemu-riscv64"
299 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinic8c320e2019-08-02 11:32:37 -0400300 <<: *buildman_and_testpy_dfn
301
Bin Mengb68d9d62020-03-28 07:25:29 -0700302qemu-riscv32_spl test.py:
303 tags: [ 'all' ]
304 variables:
305 TEST_PY_BD: "qemu-riscv32_spl"
306 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700307 <<: *buildman_and_testpy_dfn
308
309qemu-riscv64_spl test.py:
310 tags: [ 'all' ]
311 variables:
312 TEST_PY_BD: "qemu-riscv64_spl"
313 TEST_PY_TEST_SPEC: "not sleep"
Bin Mengb68d9d62020-03-28 07:25:29 -0700314 <<: *buildman_and_testpy_dfn
315
Tom Rinid2244b92019-06-19 09:25:17 -0400316qemu-x86 test.py:
317 tags: [ 'all' ]
318 variables:
319 TEST_PY_BD: "qemu-x86"
320 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400321 <<: *buildman_and_testpy_dfn
322
323qemu-x86_64 test.py:
324 tags: [ 'all' ]
325 variables:
326 TEST_PY_BD: "qemu-x86_64"
327 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400328 <<: *buildman_and_testpy_dfn
329
Michal Simekf8834fd2020-02-13 15:03:29 +0100330xilinx_zynq_virt test.py:
Tom Rinid2244b92019-06-19 09:25:17 -0400331 tags: [ 'all' ]
332 variables:
Michal Simekf8834fd2020-02-13 15:03:29 +0100333 TEST_PY_BD: "xilinx_zynq_virt"
Tom Rinid2244b92019-06-19 09:25:17 -0400334 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400335 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400336 <<: *buildman_and_testpy_dfn
337
338xilinx_versal_virt test.py:
339 tags: [ 'all' ]
340 variables:
341 TEST_PY_BD: "xilinx_versal_virt"
342 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400343 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400344 <<: *buildman_and_testpy_dfn
345
346xtfpga test.py:
347 tags: [ 'all' ]
348 variables:
349 TEST_PY_BD: "xtfpga"
350 TEST_PY_TEST_SPEC: "not sleep"
Tom Rinid2244b92019-06-19 09:25:17 -0400351 TEST_PY_ID: "--id qemu"
Tom Rinid2244b92019-06-19 09:25:17 -0400352 <<: *buildman_and_testpy_dfn