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