Skip to content
Snippets Groups Projects
.travis.yml 6.04 KiB
# global options
dist: xenial
language:
  - c
compiler:
  - gcc
cache:
  directories:
    - "${HOME}/persist"
env:
  global:
    - MAKEOPTS="-j4"

# define the successive stages
stages:
  - name: test

# define the jobs for the stages
# order of the jobs has longest running first to optimise total time
jobs:
  include:
    # stm32 port
    - stage: test
      env: NAME="stm32 port build"
      install:
        # need newer gcc version for Cortex-M7 support
        - sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
        - sudo apt-get update -qq || true
        - sudo apt-get install gcc-arm-embedded
        - sudo apt-get install libnewlib-arm-none-eabi
        - arm-none-eabi-gcc --version
      script:
        - make ${MAKEOPTS} -C mpy-cross
        - make ${MAKEOPTS} -C ports/stm32
        - make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
        - make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2
        - make ${MAKEOPTS} -C ports/stm32 BOARD=STM32F769DISC
        - make ${MAKEOPTS} -C ports/stm32 BOARD=STM32L476DISC

    # qemu-arm port
    - stage: test
      env: NAME="qemu-arm port build and tests"
      install:
        - sudo apt-get install gcc-arm-none-eabi
        - sudo apt-get install libnewlib-arm-none-eabi
        - sudo apt-get install qemu-system
        - arm-none-eabi-gcc --version
        - qemu-system-arm --version
      script:
        - make ${MAKEOPTS} -C mpy-cross
        - make ${MAKEOPTS} -C ports/qemu-arm -f Makefile.test test
      after_failure:
        - grep "FAIL" ports/qemu-arm/build/console.out

    # unix coverage
    - stage: test
      env: NAME="unix coverage build and tests"
      install:
        - sudo pip install cpp-coveralls
        - gcc --version
        - python3 --version
      script:
        - make ${MAKEOPTS} -C mpy-cross
        - make ${MAKEOPTS} -C ports/unix deplibs
        - make ${MAKEOPTS} -C ports/unix coverage
        # run the main test suite
        - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
        - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
        - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
        - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float micropython)