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