Tom Rini | 1a62a72 | 2019-06-19 09:25:17 -0400 | [diff] [blame] | 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 |
| 5 | image: trini/u-boot-gitlab-ci-runner:xenial-20190222-24April2019 |
| 6 | |
| 7 | # We run some tests in different order, to catch some failures quicker. |
| 8 | stages: |
| 9 | - test.py |
| 10 | - testsuites |
| 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` |
| 21 | - virtualenv /tmp/venv |
| 22 | - . /tmp/venv/bin/activate |
| 23 | - pip install pytest==2.8.7 |
| 24 | - pip install python-subunit |
Tom Rini | 7fd0ea2 | 2019-07-17 22:51:31 -0400 | [diff] [blame] | 25 | - pip install pyelftools |
Tom Rini | 1a62a72 | 2019-06-19 09:25:17 -0400 | [diff] [blame] | 26 | - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd |
| 27 | - grub-mkimage -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd |
| 28 | - mkdir ~/grub2-arm |
| 29 | - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di ) |
| 30 | - mkdir ~/grub2-arm64 |
| 31 | - ( cd ~/grub2-arm64; wget -O - http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm | rpm2cpio | cpio -di ) |
| 32 | - if [[ "${QEMU_TARGET}" != "" ]]; then |
| 33 | git clone git://git.qemu.org/qemu.git /tmp/qemu; |
| 34 | pushd /tmp/qemu; |
| 35 | git submodule update --init dtc && |
| 36 | git checkout ${QEMU_VERSION} && |
| 37 | ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} && |
| 38 | make -j$(nproc) all install; |
| 39 | popd; |
| 40 | fi |
| 41 | after_script: |
| 42 | - rm -rf ~/grub2* /tmp/uboot-test-hooks /tmp/qemu /tmp/venv |
| 43 | script: |
| 44 | # From buildman, exit code 129 means warnings only. If we've been asked to |
| 45 | # use clang only do one configuration. |
| 46 | - if [[ "${BUILDMAN}" != "" ]]; then |
| 47 | ret=0; |
| 48 | tools/buildman/buildman -P -E ${BUILDMAN} ${OVERRIDE}|| ret=$?; |
| 49 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then |
| 50 | tools/buildman/buildman -sdeP ${BUILDMAN}; |
| 51 | exit $ret; |
| 52 | fi; |
| 53 | fi |
| 54 | # "not a_test_which_does_not_exist" is a dummy -k parameter which will |
| 55 | # never prevent any test from running. That way, we can always pass |
| 56 | # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom |
| 57 | # value. |
| 58 | - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD}; |
| 59 | export PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin; |
| 60 | export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; |
| 61 | if [[ "${TEST_PY_BD}" != "" ]]; then |
| 62 | ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} |
| 63 | -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" |
| 64 | --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; |
| 65 | ret=$?; |
| 66 | if [[ $ret -ne 0 ]]; then |
| 67 | exit $ret; |
| 68 | fi; |
| 69 | fi; |
| 70 | |
Tom Rini | 9f7bda1 | 2019-07-17 17:51:28 -0400 | [diff] [blame^] | 71 | build all 32bit ARM plaforms: |
Tom Rini | 1a62a72 | 2019-06-19 09:25:17 -0400 | [diff] [blame] | 72 | tags: [ 'all' ] |
| 73 | stage: world build |
| 74 | script: |
| 75 | - ret=0; |
Tom Rini | 9f7bda1 | 2019-07-17 17:51:28 -0400 | [diff] [blame^] | 76 | ./tools/buildman/buildman -P -E arm -x aarch64 || ret=$?; |
| 77 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then |
| 78 | ./tools/buildman/buildman -sdeP; |
| 79 | exit $ret; |
| 80 | fi; |
| 81 | |
| 82 | build all 64bit ARM plaforms: |
| 83 | tags: [ 'all' ] |
| 84 | stage: world build |
| 85 | script: |
| 86 | - ret=0; |
| 87 | ./tools/buildman/buildman -P -E aarch64 || ret=$?; |
| 88 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then |
| 89 | ./tools/buildman/buildman -sdeP; |
| 90 | exit $ret; |
| 91 | fi; |
| 92 | |
| 93 | build all PowerPC plaforms: |
| 94 | tags: [ 'all' ] |
| 95 | stage: world build |
| 96 | script: |
| 97 | - ret=0; |
| 98 | ./tools/buildman/buildman -P -E powerpc || ret=$?; |
| 99 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then |
| 100 | ./tools/buildman/buildman -sdeP; |
| 101 | exit $ret; |
| 102 | fi; |
| 103 | |
| 104 | build all other plaforms: |
| 105 | tags: [ 'all' ] |
| 106 | stage: world build |
| 107 | script: |
| 108 | - ret=0; |
| 109 | ./tools/buildman/buildman -P -E -x arm,powerpc || ret=$?; |
Tom Rini | 1a62a72 | 2019-06-19 09:25:17 -0400 | [diff] [blame] | 110 | if [[ $ret -ne 0 && $ret -ne 129 ]]; then |
| 111 | ./tools/buildman/buildman -sdeP; |
| 112 | exit $ret; |
| 113 | fi; |
| 114 | |
| 115 | # QA jobs for code analytics |
| 116 | # static code analysis with cppcheck (we can add --enable=all later) |
| 117 | cppcheck: |
| 118 | tags: [ 'all' ] |
| 119 | stage: testsuites |
| 120 | script: |
| 121 | - cppcheck --force --quiet --inline-suppr . |
| 122 | |
| 123 | # search for TODO within source tree |
| 124 | grep TODO/FIXME/HACK: |
| 125 | tags: [ 'all' ] |
| 126 | stage: testsuites |
| 127 | script: |
| 128 | - grep -r TODO . |
| 129 | - grep -r FIXME . |
| 130 | # search for HACK within source tree and ignore HACKKIT board |
| 131 | - grep -r HACK . | grep -v HACKKIT |
| 132 | |
| 133 | # some statistics about the code base |
| 134 | sloccount: |
| 135 | tags: [ 'all' ] |
| 136 | stage: testsuites |
| 137 | script: |
| 138 | - sloccount . |
| 139 | |
| 140 | # ensure all configs have MAINTAINERS entries |
| 141 | Check for configs without MAINTAINERS entry: |
| 142 | tags: [ 'all' ] |
| 143 | stage: testsuites |
| 144 | script: |
| 145 | - if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi |
| 146 | |
| 147 | # Ensure host tools build |
| 148 | Build tools-only: |
| 149 | tags: [ 'all' ] |
| 150 | stage: testsuites |
| 151 | script: |
| 152 | - make tools-only_config tools-only -j$(nproc) |
| 153 | |
| 154 | # Run various tool tests |
| 155 | Run patman testsuite: |
| 156 | tags: [ 'all' ] |
| 157 | stage: testsuites |
| 158 | script: |
| 159 | - git config --global user.name "GitLab CI Runner" |
| 160 | - git config --global user.email trini@konsulko.com |
| 161 | - ./tools/patman/patman --test |
| 162 | |
| 163 | Run buildman testsuite: |
| 164 | tags: [ 'all' ] |
| 165 | stage: testsuites |
| 166 | script: |
| 167 | - ./tools/buildman/buildman -t |
| 168 | |
| 169 | Run binman and dtoc testsuite: |
| 170 | tags: [ 'all' ] |
| 171 | stage: testsuites |
| 172 | script: |
| 173 | - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/sandbox_spl; |
| 174 | ./tools/buildman/buildman -P sandbox_spl && |
| 175 | export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"; |
| 176 | export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"; |
| 177 | ./tools/binman/binman -t && |
| 178 | ./tools/dtoc/dtoc -t |
| 179 | |
| 180 | # Test sandbox with test.py |
| 181 | sandbox test.py: |
| 182 | tags: [ 'all' ] |
| 183 | variables: |
| 184 | TEST_PY_BD: "sandbox" |
| 185 | BUILDMAN: "^sandbox$" |
| 186 | <<: *buildman_and_testpy_dfn |
| 187 | |
| 188 | sandbox_spl test.py: |
| 189 | tags: [ 'all' ] |
| 190 | variables: |
| 191 | TEST_PY_BD: "sandbox_spl" |
| 192 | BUILDMAN: "^sandbox_spl$" |
| 193 | TEST_PY_TEST_SPEC: "test_ofplatdata" |
| 194 | <<: *buildman_and_testpy_dfn |
| 195 | |
Tom Rini | 699c0b9 | 2019-07-17 16:06:57 -0400 | [diff] [blame] | 196 | evb-ast2500 test.py: |
| 197 | tags: [ 'all' ] |
| 198 | variables: |
| 199 | TEST_PY_BD: "evb-ast2500" |
| 200 | TEST_PY_ID: "--id qemu" |
| 201 | QEMU_TARGET: "arm-softmmu" |
| 202 | QEMU_VERSION: "506179e42112be77bfd071f050b15762d3b2cd43" |
| 203 | BUILDMAN: "^evb-ast2500$" |
| 204 | <<: *buildman_and_testpy_dfn |
| 205 | |
Tom Rini | 1a62a72 | 2019-06-19 09:25:17 -0400 | [diff] [blame] | 206 | sandbox_flattree test.py: |
| 207 | tags: [ 'all' ] |
| 208 | variables: |
| 209 | TEST_PY_BD: "sandbox_flattree" |
| 210 | BUILDMAN: "^sandbox_flattree$" |
| 211 | <<: *buildman_and_testpy_dfn |
| 212 | |
| 213 | vexpress_ca15_tc2 test.py: |
| 214 | tags: [ 'all' ] |
| 215 | variables: |
| 216 | TEST_PY_BD: "vexpress_ca15_tc2" |
| 217 | TEST_PY_ID: "--id qemu" |
| 218 | QEMU_TARGET: "arm-softmmu" |
| 219 | QEMU_VERSION: "v3.0.0" |
| 220 | BUILDMAN: "^vexpress_ca15_tc2$" |
| 221 | <<: *buildman_and_testpy_dfn |
| 222 | |
| 223 | vexpress_ca9x4 test.py: |
| 224 | tags: [ 'all' ] |
| 225 | variables: |
| 226 | TEST_PY_BD: "vexpress_ca9x4" |
| 227 | TEST_PY_ID: "--id qemu" |
| 228 | QEMU_TARGET: "arm-softmmu" |
| 229 | BUILDMAN: "^vexpress_ca9x4$" |
| 230 | <<: *buildman_and_testpy_dfn |
| 231 | |
| 232 | integratorcp_cm926ejs test.py: |
| 233 | tags: [ 'all' ] |
| 234 | variables: |
| 235 | TEST_PY_BD: "integratorcp_cm926ejs" |
| 236 | TEST_PY_TEST_SPEC: "not sleep" |
| 237 | TEST_PY_ID: "--id qemu" |
| 238 | QEMU_TARGET: "arm-softmmu" |
| 239 | BUILDMAN: "^integratorcp_cm926ejs$" |
| 240 | <<: *buildman_and_testpy_dfn |
| 241 | |
| 242 | qemu_arm test.py: |
| 243 | tags: [ 'all' ] |
| 244 | variables: |
| 245 | TEST_PY_BD: "qemu_arm" |
| 246 | TEST_PY_TEST_SPEC: "not sleep" |
| 247 | QEMU_TARGET: "arm-softmmu" |
| 248 | BUILDMAN: "^qemu_arm$" |
| 249 | <<: *buildman_and_testpy_dfn |
| 250 | |
| 251 | qemu_arm64 test.py: |
| 252 | tags: [ 'all' ] |
| 253 | variables: |
| 254 | TEST_PY_BD: "qemu_arm64" |
| 255 | TEST_PY_TEST_SPEC: "not sleep" |
| 256 | QEMU_TARGET: "aarch64-softmmu" |
| 257 | BUILDMAN: "^qemu_arm64$" |
| 258 | <<: *buildman_and_testpy_dfn |
| 259 | |
| 260 | qemu_mips test.py: |
| 261 | tags: [ 'all' ] |
| 262 | variables: |
| 263 | TEST_PY_BD: "qemu_mips" |
| 264 | TEST_PY_TEST_SPEC: "not sleep" |
| 265 | QEMU_TARGET: "mips-softmmu" |
| 266 | BUILDMAN: "^qemu_mips$" |
| 267 | TOOLCHAIN: "mips" |
| 268 | <<: *buildman_and_testpy_dfn |
| 269 | |
| 270 | qemu_mipsel test.py: |
| 271 | tags: [ 'all' ] |
| 272 | variables: |
| 273 | TEST_PY_BD: "qemu_mipsel" |
| 274 | TEST_PY_TEST_SPEC: "not sleep" |
| 275 | QEMU_TARGET: "mipsel-softmmu" |
| 276 | BUILDMAN: "^qemu_mipsel$" |
| 277 | TOOLCHAIN: "mips" |
| 278 | <<: *buildman_and_testpy_dfn |
| 279 | |
| 280 | qemu_mips64 test.py: |
| 281 | tags: [ 'all' ] |
| 282 | variables: |
| 283 | TEST_PY_BD: "qemu_mips64" |
| 284 | TEST_PY_TEST_SPEC: "not sleep" |
| 285 | QEMU_TARGET: "mips64-softmmu" |
| 286 | BUILDMAN: "^qemu_mips64$" |
| 287 | TOOLCHAIN: "mips" |
| 288 | <<: *buildman_and_testpy_dfn |
| 289 | |
| 290 | qemu_mips64el test.py: |
| 291 | tags: [ 'all' ] |
| 292 | variables: |
| 293 | TEST_PY_BD: "qemu_mips64el" |
| 294 | TEST_PY_TEST_SPEC: "not sleep" |
| 295 | QEMU_TARGET: "mips64el-softmmu" |
| 296 | BUILDMAN: "^qemu_mips64el$" |
| 297 | TOOLCHAIN: "mips" |
| 298 | <<: *buildman_and_testpy_dfn |
| 299 | |
| 300 | qemu-ppce500 test.py: |
| 301 | tags: [ 'all' ] |
| 302 | variables: |
| 303 | TEST_PY_BD: "qemu-ppce500" |
| 304 | TEST_PY_TEST_SPEC: "not sleep" |
| 305 | QEMU_TARGET: "ppc-softmmu" |
| 306 | BUILDMAN: "^qemu-ppce500$" |
| 307 | TOOLCHAIN: "powerpc" |
| 308 | <<: *buildman_and_testpy_dfn |
| 309 | |
| 310 | qemu-x86 test.py: |
| 311 | tags: [ 'all' ] |
| 312 | variables: |
| 313 | TEST_PY_BD: "qemu-x86" |
| 314 | TEST_PY_TEST_SPEC: "not sleep" |
| 315 | QEMU_TARGET: "i386-softmmu" |
| 316 | BUILDMAN: "^qemu-x86$" |
| 317 | TOOLCHAIN: "i386" |
| 318 | <<: *buildman_and_testpy_dfn |
| 319 | |
| 320 | qemu-x86_64 test.py: |
| 321 | tags: [ 'all' ] |
| 322 | variables: |
| 323 | TEST_PY_BD: "qemu-x86_64" |
| 324 | TEST_PY_TEST_SPEC: "not sleep" |
| 325 | QEMU_TARGET: "x86_64-softmmu" |
| 326 | BUILDMAN: "^qemu-x86_64$" |
| 327 | TOOLCHAIN: "i386" |
| 328 | <<: *buildman_and_testpy_dfn |
| 329 | |
| 330 | zynq_zc702 test.py: |
| 331 | tags: [ 'all' ] |
| 332 | variables: |
| 333 | TEST_PY_BD: "zynq_zc702" |
| 334 | TEST_PY_TEST_SPEC: "not sleep" |
| 335 | QEMU_TARGET: "arm-softmmu" |
| 336 | TEST_PY_ID: "--id qemu" |
| 337 | BUILDMAN: "^zynq_zc702$" |
| 338 | <<: *buildman_and_testpy_dfn |
| 339 | |
| 340 | xilinx_versal_virt test.py: |
| 341 | tags: [ 'all' ] |
| 342 | variables: |
| 343 | TEST_PY_BD: "xilinx_versal_virt" |
| 344 | TEST_PY_TEST_SPEC: "not sleep" |
| 345 | QEMU_TARGET: "aarch64-softmmu" |
| 346 | TEST_PY_ID: "--id qemu" |
| 347 | BUILDMAN: "^xilinx_versal_virt$" |
| 348 | <<: *buildman_and_testpy_dfn |
| 349 | |
| 350 | xtfpga test.py: |
| 351 | tags: [ 'all' ] |
| 352 | variables: |
| 353 | TEST_PY_BD: "xtfpga" |
| 354 | TEST_PY_TEST_SPEC: "not sleep" |
| 355 | QEMU_TARGET: "xtensa-softmmu" |
| 356 | TEST_PY_ID: "--id qemu" |
| 357 | BUILDMAN: "^xtfpga$" |
| 358 | TOOLCHAIN: "xtensa-dc233c-elf" |
| 359 | <<: *buildman_and_testpy_dfn |