.travis.yml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. # global options
  2. language:
  3. - c
  4. compiler:
  5. - gcc
  6. cache:
  7. directories:
  8. - "${HOME}/persist"
  9. env:
  10. global:
  11. - MAKEOPTS="-j4"
  12. # define the successive stages
  13. stages:
  14. - name: test
  15. # define the jobs for the stages
  16. # order of the jobs has longest running first to optimise total time
  17. jobs:
  18. include:
  19. # stm32 port
  20. - stage: test
  21. env: NAME="stm32 port build"
  22. install:
  23. # need newer gcc version for Cortex-M7 support
  24. - sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
  25. - sudo apt-get update -qq || true
  26. - sudo apt-get install --allow-unauthenticated gcc-arm-none-eabi
  27. - arm-none-eabi-gcc --version
  28. script:
  29. - make ${MAKEOPTS} -C mpy-cross
  30. - make ${MAKEOPTS} -C ports/stm32
  31. - make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
  32. - make ${MAKEOPTS} -C ports/stm32 BOARD=STM32F769DISC
  33. - make ${MAKEOPTS} -C ports/stm32 BOARD=STM32L476DISC
  34. # qemu-arm port
  35. - stage: test
  36. env: NAME="qemu-arm port build and tests"
  37. install:
  38. # need newer gcc version for nano.specs
  39. - sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded
  40. - sudo apt-get update -qq || true
  41. - sudo apt-get install --allow-unauthenticated gcc-arm-none-eabi
  42. - sudo apt-get install qemu-system
  43. - arm-none-eabi-gcc --version
  44. script:
  45. - make ${MAKEOPTS} -C mpy-cross
  46. - make ${MAKEOPTS} -C ports/qemu-arm -f Makefile.test test
  47. after_failure:
  48. - grep "FAIL" ports/qemu-arm/build/console.out
  49. # unix coverage
  50. - stage: test
  51. env: NAME="unix coverage build and tests"
  52. install:
  53. # a specific urllib3 version is needed for requests and cpp-coveralls to work together
  54. - sudo pip install -Iv urllib3==1.22
  55. - sudo pip install cpp-coveralls
  56. - gcc --version
  57. - python3 --version
  58. script:
  59. - make ${MAKEOPTS} -C mpy-cross
  60. - make ${MAKEOPTS} -C ports/unix deplibs
  61. - make ${MAKEOPTS} -C ports/unix coverage
  62. # run the main test suite
  63. - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
  64. - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
  65. - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
  66. - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float)
  67. # test when input script comes from stdin
  68. - cat tests/basics/0prelim.py | ports/unix/micropython_coverage | grep -q 'abc'
  69. # run coveralls coverage analysis (try to, even if some builds/tests failed)
  70. - (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
  71. after_failure:
  72. - (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
  73. # standard unix port
  74. - stage: test
  75. env: NAME="unix port build and tests"
  76. script:
  77. - make ${MAKEOPTS} -C mpy-cross
  78. - make ${MAKEOPTS} -C ports/unix deplibs
  79. - make ${MAKEOPTS} -C ports/unix
  80. - make ${MAKEOPTS} -C ports/unix test
  81. # unix nanbox
  82. - stage: test
  83. env: NAME="unix nanbox port build and tests"
  84. install:
  85. - sudo apt-get install gcc-multilib libffi-dev:i386
  86. script:
  87. - make ${MAKEOPTS} -C mpy-cross
  88. - make ${MAKEOPTS} -C ports/unix deplibs
  89. - make ${MAKEOPTS} -C ports/unix nanbox
  90. - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_nanbox ./run-tests)
  91. # unix stackless
  92. - stage: test
  93. env: NAME="unix stackless port build and tests"
  94. script:
  95. - make ${MAKEOPTS} -C mpy-cross
  96. - make ${MAKEOPTS} -C ports/unix deplibs
  97. - make ${MAKEOPTS} -C ports/unix CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1"
  98. - make ${MAKEOPTS} -C ports/unix test
  99. # windows port via mingw
  100. - stage: test
  101. env: NAME="windows port build via mingw"
  102. install:
  103. - sudo apt-get install gcc-mingw-w64
  104. script:
  105. - make ${MAKEOPTS} -C mpy-cross
  106. - make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
  107. # nrf port
  108. - stage: test
  109. env: NAME="nrf port build"
  110. install:
  111. # need newer gcc version to support variables in linker script
  112. - sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
  113. - sudo apt-get update -qq || true
  114. - sudo apt-get install gcc-arm-embedded
  115. - arm-none-eabi-gcc --version
  116. script:
  117. - make ${MAKEOPTS} -C ports/nrf
  118. # bare-arm and minimal ports
  119. - stage: test
  120. env: NAME="bare-arm and minimal ports build"
  121. install:
  122. - sudo apt-get install gcc-arm-none-eabi
  123. - arm-none-eabi-gcc --version
  124. script:
  125. - make ${MAKEOPTS} -C ports/bare-arm
  126. - make ${MAKEOPTS} -C ports/minimal CROSS=1 build/firmware.bin
  127. - ls -l ports/minimal/build/firmware.bin
  128. - tools/check_code_size.sh
  129. - mkdir -p ${HOME}/persist
  130. # Save new firmware for reference, but only if building a main branch, not a pull request
  131. - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
  132. # cc3200 port
  133. - stage: test
  134. env: NAME="cc3200 port build"
  135. install:
  136. - sudo apt-get install gcc-arm-none-eabi
  137. script:
  138. - make ${MAKEOPTS} -C ports/cc3200 BTARGET=application BTYPE=release
  139. - make ${MAKEOPTS} -C ports/cc3200 BTARGET=bootloader BTYPE=release
  140. # teensy port
  141. - stage: test
  142. env: NAME="teensy port build"
  143. install:
  144. - sudo apt-get install gcc-arm-none-eabi
  145. script:
  146. - make ${MAKEOPTS} -C ports/teensy