2018-07-18 02:39:39 +00:00
|
|
|
# global options
|
2019-02-11 23:55:48 +00:00
|
|
|
dist: xenial
|
2018-07-18 02:39:39 +00:00
|
|
|
language:
|
|
|
|
- c
|
2014-04-14 18:05:47 +00:00
|
|
|
compiler:
|
|
|
|
- gcc
|
2016-10-25 08:07:29 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- "${HOME}/persist"
|
2018-03-09 00:34:46 +00:00
|
|
|
env:
|
2018-07-18 02:39:39 +00:00
|
|
|
global:
|
|
|
|
- MAKEOPTS="-j4"
|
2019-06-24 02:05:17 +00:00
|
|
|
git:
|
|
|
|
submodules: false
|
2014-04-14 18:05:47 +00:00
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# define the successive stages
|
|
|
|
stages:
|
|
|
|
- name: test
|
2014-04-14 18:05:47 +00:00
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# 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
|
2019-02-11 23:55:48 +00:00
|
|
|
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
|
2018-07-18 02:39:39 +00:00
|
|
|
- sudo apt-get update -qq || true
|
2019-02-11 23:55:48 +00:00
|
|
|
- sudo apt-get install gcc-arm-embedded
|
|
|
|
- sudo apt-get install libnewlib-arm-none-eabi
|
2018-07-18 02:39:39 +00:00
|
|
|
- arm-none-eabi-gcc --version
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C mpy-cross
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32 submodules
|
2019-09-26 01:19:08 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_F091RC
|
2018-07-18 02:39:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1
|
2019-05-31 12:47:00 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2
|
2019-09-26 01:19:08 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_H743ZI CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1'
|
|
|
|
- make ${MAKEOPTS} -C ports/stm32 BOARD=B_L072Z_LRWAN1
|
2018-07-18 02:39:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32 BOARD=STM32L476DISC
|
2019-09-26 01:19:08 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_WB55
|
2019-07-09 01:47:57 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6
|
2014-05-11 17:33:13 +00:00
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# qemu-arm port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="qemu-arm port build and tests"
|
|
|
|
install:
|
2019-02-11 23:55:48 +00:00
|
|
|
- sudo apt-get install gcc-arm-none-eabi
|
|
|
|
- sudo apt-get install libnewlib-arm-none-eabi
|
2018-07-18 02:39:39 +00:00
|
|
|
- sudo apt-get install qemu-system
|
|
|
|
- arm-none-eabi-gcc --version
|
2019-02-11 23:55:48 +00:00
|
|
|
- qemu-system-arm --version
|
2018-07-18 02:39:39 +00:00
|
|
|
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
|
2015-03-01 13:37:27 +00:00
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# unix coverage
|
|
|
|
- stage: test
|
|
|
|
env: NAME="unix coverage build and tests"
|
|
|
|
install:
|
2019-12-12 06:45:02 +00:00
|
|
|
- sudo apt-get install python3-pip
|
2018-07-18 02:39:39 +00:00
|
|
|
- sudo pip install cpp-coveralls
|
2019-12-12 06:45:02 +00:00
|
|
|
- sudo pip3 install setuptools
|
|
|
|
- sudo pip3 install pyelftools
|
2018-07-18 02:39:39 +00:00
|
|
|
- gcc --version
|
|
|
|
- python3 --version
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C mpy-cross
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/unix submodules
|
2018-07-18 02:39:39 +00:00
|
|
|
- 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)
|
2019-02-24 13:20:05 +00:00
|
|
|
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float micropython)
|
|
|
|
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy --emit native -d basics float micropython)
|
2018-07-18 02:39:39 +00:00
|
|
|
# test when input script comes from stdin
|
|
|
|
- cat tests/basics/0prelim.py | ports/unix/micropython_coverage | grep -q 'abc'
|
2019-12-12 06:45:02 +00:00
|
|
|
# test building native mpy modules
|
|
|
|
- make -C examples/natmod/features1 ARCH=x64
|
|
|
|
- make -C examples/natmod/features2 ARCH=x64
|
|
|
|
- make -C examples/natmod/btree ARCH=x64
|
|
|
|
- make -C examples/natmod/framebuf ARCH=x64
|
|
|
|
- make -C examples/natmod/uheapq ARCH=x64
|
2019-12-13 02:32:15 +00:00
|
|
|
- make -C examples/natmod/urandom ARCH=x64
|
2019-12-12 06:45:02 +00:00
|
|
|
- make -C examples/natmod/ure ARCH=x64
|
|
|
|
- make -C examples/natmod/uzlib ARCH=x64
|
|
|
|
# test importing .mpy generated by mpy_ld.py
|
|
|
|
- MICROPYPATH=examples/natmod/features2 ./ports/unix/micropython_coverage -m features2
|
|
|
|
- (cd tests && ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py)
|
2018-07-18 02:39:39 +00:00
|
|
|
# run coveralls coverage analysis (try to, even if some builds/tests failed)
|
|
|
|
- (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
|
|
|
|
after_failure:
|
|
|
|
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
|
2015-03-01 13:37:27 +00:00
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# standard unix port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="unix port build and tests"
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C mpy-cross
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/unix submodules
|
2018-07-18 02:39:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/unix deplibs
|
|
|
|
- make ${MAKEOPTS} -C ports/unix
|
|
|
|
- make ${MAKEOPTS} -C ports/unix test
|
2019-06-26 04:29:06 +00:00
|
|
|
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython ./run-perfbench.py 1000 1000)
|
2018-02-08 00:30:19 +00:00
|
|
|
|
2019-10-01 02:51:57 +00:00
|
|
|
# unix nanbox (and using Python 2 to check it can run the build scripts)
|
2018-07-18 02:39:39 +00:00
|
|
|
- stage: test
|
|
|
|
env: NAME="unix nanbox port build and tests"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install gcc-multilib libffi-dev:i386
|
|
|
|
script:
|
2019-10-01 02:51:57 +00:00
|
|
|
- make ${MAKEOPTS} -C mpy-cross PYTHON=python2
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/unix submodules
|
2019-10-01 02:51:57 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/unix PYTHON=python2 deplibs
|
|
|
|
- make ${MAKEOPTS} -C ports/unix PYTHON=python2 nanbox
|
2018-07-18 02:39:39 +00:00
|
|
|
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_nanbox ./run-tests)
|
2014-04-15 11:52:59 +00:00
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# unix stackless
|
|
|
|
- stage: test
|
2019-07-08 07:18:47 +00:00
|
|
|
env: NAME="unix stackless port build and tests with clang"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install clang
|
2018-07-18 02:39:39 +00:00
|
|
|
script:
|
2019-07-08 07:18:47 +00:00
|
|
|
- make ${MAKEOPTS} -C mpy-cross CC=clang
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/unix submodules
|
2019-07-08 07:18:47 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/unix CC=clang CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1"
|
|
|
|
- make ${MAKEOPTS} -C ports/unix CC=clang test
|
2017-12-16 18:43:30 +00:00
|
|
|
|
2019-08-27 05:43:10 +00:00
|
|
|
# unix with sys.settrace
|
|
|
|
- stage: test
|
|
|
|
env: NAME="unix port with sys.settrace build and tests"
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C mpy-cross
|
|
|
|
- make ${MAKEOPTS} -C ports/unix MICROPY_PY_BTREE=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 CFLAGS_EXTRA="-DMICROPY_PY_SYS_SETTRACE=1" test
|
|
|
|
- make ${MAKEOPTS} -C ports/unix clean
|
|
|
|
- make ${MAKEOPTS} -C ports/unix MICROPY_PY_BTREE=0 MICROPY_PY_FFI=0 MICROPY_PY_USSL=0 CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1 -DMICROPY_PY_SYS_SETTRACE=1" test
|
|
|
|
after_failure:
|
|
|
|
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
|
|
|
|
|
2019-10-29 11:23:00 +00:00
|
|
|
# minimal unix port with tests
|
|
|
|
- stage: test
|
|
|
|
env: NAME="minimal unix port build and tests"
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C ports/unix minimal
|
|
|
|
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython_minimal ./run-tests -e exception_chain -e self_type_check -e subclass_native_init -d basics)
|
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# windows port via mingw
|
|
|
|
- stage: test
|
|
|
|
env: NAME="windows port build via mingw"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install gcc-mingw-w64
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C mpy-cross
|
|
|
|
- make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
|
|
|
|
|
2019-06-25 01:18:36 +00:00
|
|
|
# esp32 port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="esp32 port build"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install python3-pip
|
2019-09-13 13:48:28 +00:00
|
|
|
- sudo pip3 install 'pyparsing<2.4'
|
2019-06-25 01:18:36 +00:00
|
|
|
- wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
|
|
|
|
- zcat xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz | tar x
|
|
|
|
- export PATH=$(pwd)/xtensa-esp32-elf/bin:$PATH
|
|
|
|
- git clone https://github.com/espressif/esp-idf.git
|
2019-09-13 13:48:28 +00:00
|
|
|
- export IDF_PATH=$(pwd)/esp-idf
|
2019-06-25 01:18:36 +00:00
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C mpy-cross
|
2019-09-13 13:48:28 +00:00
|
|
|
# IDF v3 build
|
|
|
|
- git -C esp-idf checkout $(grep "ESPIDF_SUPHASH_V3 :=" ports/esp32/Makefile | cut -d " " -f 3)
|
|
|
|
- git -C esp-idf submodule update --init components/json/cJSON components/esp32/lib components/esptool_py/esptool components/expat/expat components/lwip/lwip components/mbedtls/mbedtls components/micro-ecc/micro-ecc components/nghttp/nghttp2
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/esp32 submodules
|
2019-09-13 13:48:28 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/esp32
|
|
|
|
# clean
|
|
|
|
- git -C esp-idf clean -f -f -d components/json/cJSON components/esp32/lib components/expat/expat components/micro-ecc/micro-ecc components/nghttp/nghttp2
|
|
|
|
- make ${MAKEOPTS} -C ports/esp32 clean
|
|
|
|
# IDF v4 build
|
|
|
|
- git -C esp-idf checkout $(grep "ESPIDF_SUPHASH_V4 :=" ports/esp32/Makefile | cut -d " " -f 3)
|
2019-10-08 03:27:44 +00:00
|
|
|
- git -C esp-idf submodule update --init components/bt/controller/lib components/bt/host/nimble/nimble components/esp_wifi/lib_esp32 components/esptool_py/esptool components/lwip/lwip components/mbedtls/mbedtls
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/esp32 submodules
|
2019-09-13 13:48:28 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/esp32
|
2019-06-25 01:18:36 +00:00
|
|
|
|
2019-06-24 02:52:34 +00:00
|
|
|
# esp8266 port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="esp8266 port build"
|
|
|
|
install:
|
|
|
|
- wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz
|
|
|
|
- zcat xtensa-lx106-elf-standalone.tar.gz | tar x
|
|
|
|
- export PATH=$(pwd)/xtensa-lx106-elf/bin:$PATH
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C mpy-cross
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/esp8266 submodules
|
2019-06-24 02:52:34 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/esp8266
|
2019-09-30 07:26:41 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/esp8266 BOARD=GENERIC_512K
|
2019-06-24 02:52:34 +00:00
|
|
|
|
2018-07-19 00:36:38 +00:00
|
|
|
# nrf port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="nrf port build"
|
|
|
|
install:
|
2019-02-11 23:55:48 +00:00
|
|
|
- sudo apt-get install gcc-arm-none-eabi
|
|
|
|
- sudo apt-get install libnewlib-arm-none-eabi
|
2018-07-19 00:36:38 +00:00
|
|
|
- arm-none-eabi-gcc --version
|
|
|
|
script:
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/nrf submodules
|
2018-07-19 00:36:38 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/nrf
|
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# bare-arm and minimal ports
|
|
|
|
- stage: test
|
|
|
|
env: NAME="bare-arm and minimal ports build"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install gcc-arm-none-eabi
|
2019-02-11 23:55:48 +00:00
|
|
|
- sudo apt-get install libnewlib-arm-none-eabi
|
2018-07-18 02:39:39 +00:00
|
|
|
- arm-none-eabi-gcc --version
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C ports/bare-arm
|
|
|
|
- make ${MAKEOPTS} -C ports/minimal CROSS=1 build/firmware.bin
|
|
|
|
- ls -l ports/minimal/build/firmware.bin
|
|
|
|
- tools/check_code_size.sh
|
|
|
|
- mkdir -p ${HOME}/persist
|
|
|
|
# Save new firmware for reference, but only if building a main branch, not a pull request
|
|
|
|
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
|
|
|
|
|
|
|
|
# cc3200 port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="cc3200 port build"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install gcc-arm-none-eabi
|
2019-02-11 23:55:48 +00:00
|
|
|
- sudo apt-get install libnewlib-arm-none-eabi
|
2018-07-18 02:39:39 +00:00
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C ports/cc3200 BTARGET=application BTYPE=release
|
|
|
|
- make ${MAKEOPTS} -C ports/cc3200 BTARGET=bootloader BTYPE=release
|
|
|
|
|
2019-06-22 13:06:42 +00:00
|
|
|
# samd port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="samd port build"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install gcc-arm-none-eabi
|
|
|
|
- sudo apt-get install libnewlib-arm-none-eabi
|
|
|
|
script:
|
2019-10-14 01:09:39 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/samd submodules
|
2019-06-22 13:06:42 +00:00
|
|
|
- make ${MAKEOPTS} -C ports/samd
|
|
|
|
|
2018-07-18 02:39:39 +00:00
|
|
|
# teensy port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="teensy port build"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install gcc-arm-none-eabi
|
2019-02-11 23:55:48 +00:00
|
|
|
- sudo apt-get install libnewlib-arm-none-eabi
|
2018-07-18 02:39:39 +00:00
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C ports/teensy
|
2019-08-22 00:21:48 +00:00
|
|
|
|
|
|
|
# powerpc port
|
|
|
|
- stage: test
|
|
|
|
env: NAME="powerpc port build"
|
|
|
|
install:
|
|
|
|
- sudo apt-get install gcc-powerpc64le-linux-gnu
|
|
|
|
- sudo apt-get install libc6-dev-ppc64el-cross
|
|
|
|
script:
|
|
|
|
- make ${MAKEOPTS} -C ports/powerpc CROSS_COMPILE=powerpc64le-linux-gnu-
|