mbed-os/.travis.yml

207 lines
7.9 KiB
YAML
Raw Normal View History

language: python
python:
'2.7'
env:
global:
- >
2018-02-16 21:47:33 +00:00
STATUS=$'curl -so/dev/null --user "$MBED_BOT" --request POST
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}
--data @- << DATA\n{
"state": "$0",
"description": "$1",
"context": "travis-ci/$NAME/$(python --version)",
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
}\nDATA'
cache:
pip: true
directories:
- $HOME/.cache/apt
- $HOME/gcc-arm-none-eabi-6-2017-q2-update
before_install:
- bash -c "$STATUS" pending "Local $NAME testing is in progress"
# Make sure pipefail
- set -o pipefail
# Setup apt to cache
- mkdir -p $HOME/.cache/apt/partial
- sudo rm -rf /var/cache/apt/archives
- sudo ln -s $HOME/.cache/apt /var/cache/apt/archives
# Setup ppa to make sure arm-none-eabi-gcc is correct version
- sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
# Loop until update succeeds (timeouts can occur)
2018-02-17 01:47:01 +00:00
- while [ -n "$(sudo apt-get update 2>&1 |grep Failed)" ]; do :; done
after_success:
- bash -c "$STATUS" success "Local $NAME testing has passed"
after_failure:
- bash -c "$STATUS" failure "Local $NAME testing has failed"
matrix:
include:
- env:
- NAME=docs
install:
# Install dependencies
- sudo apt-get install doxygen
# Print versions we use
- doxygen --version
before_script:
# Create BUILD directory for tests
- mkdir BUILD
script:
# Assert that the Doxygen build produced no warnings.
# The strange command below asserts that the Doxygen command had an
# output of zero length
- >
doxygen doxyfile_options 2>&1 |
tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
# Assert that all binary libraries are named correctly
# The strange command below asserts that there are exactly 0 libraries
# that do not start with lib
- >
find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" |
tee BUILD/badlibs |
sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
# Assert that all assebler files are named correctly
# The strange command below asserts that there are exactly 0 libraries
# that do end with .s
- >
find -name "*.s" | tee BUILD/badasm |
sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
- env:
- NAME=tools
python:
- '2.7'
- '3.5'
- '3.6'
install:
# Install dependencies
- sudo apt-get install gcc-arm-embedded
- pip install -r requirements.txt
- pip install pytest pylint hypothesis mock coverage coveralls
# Print versions we use
- arm-none-eabi-gcc --version
- python --version
script:
# Run local testing on tools
- PYTHONPATH=. coverage run -a -m pytest tools/test
- python2 tools/test/pylint.py
- coverage run -a tools/project.py -S | sed -n '/^Total/p'
- coverage html
after_success:
# Coverage for tools
- coveralls
# Report success since we have overridden default behaviour
- bash -c "$STATUS" success "Local $NAME testing has passed"
- env:
- NAME=events
- EVENTS=events
install:
# Install dependencies
- sudo apt-get install gcc-arm-embedded
- pip install -r requirements.txt
# Print versions we use
- arm-none-eabi-gcc --version
- gcc --version
- python --version
script:
# Check that example compiles
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
- python tools/make.py -t GCC_ARM -m K64F --source=. --build=BUILD/K64F/GCC_ARM -j0
# Check that example compiles without rtos
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
- rm -r rtos features/netsocket features/frameworks BUILD
- python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0
# Run local equeue tests
- make -C $EVENTS/equeue test
- env:
- NAME=littlefs
- LITTLEFS=features/filesystem/littlefs
install:
# Install dependencies
- sudo apt-get install gcc-arm-embedded fuse libfuse-dev
- pip install -r requirements.txt
- git clone https://github.com/armmbed/spiflash-driver.git
# Print versions
- arm-none-eabi-gcc --version
- gcc --version
- python --version
- fusermount --version
before_script:
# Setup and patch littlefs-fuse
- git clone https://github.com/geky/littlefs-fuse littlefs_fuse
- git -C littlefs_fuse checkout 3f1ed6e37799e49e3710830dc6abb926d5503cf2
- echo '*' > littlefs_fuse/.mbedignore
- rm -rf littlefs_fuse/littlefs/*
- cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) littlefs_fuse/littlefs
# Create file-backed disk
- mkdir MOUNT
- sudo chmod a+rw /dev/loop0
- dd if=/dev/zero bs=512 count=2048 of=DISK
- losetup /dev/loop0 DISK
script:
# Check that example compiles
- sed -n '/``` c++/,/```/{/```/d;p;}' $LITTLEFS/README.md > main.cpp
- python tools/make.py -t GCC_ARM -m K82F --source=. --build=BUILD/K82F/GCC_ARM -j0
# Run local littlefs tests
- CFLAGS="-Wno-format" make -C$LITTLEFS/littlefs test QUIET=1
# Run local littlefs tests with set of variations
- CFLAGS="-Wno-format -DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64" make -C$LITTLEFS/littlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1" make -C$LITTLEFS/littlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make -C$LITTLEFS/littlefs test QUIET=1
- CFLAGS="-Wno-format -DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048" make -C$LITTLEFS/littlefs test QUIET=1
# Self-hosting littlefs fuzz test with littlefs-fuse
- make -Clittlefs_fuse
- littlefs_fuse/lfs --format /dev/loop0
- littlefs_fuse/lfs /dev/loop0 MOUNT
- ls MOUNT
- mkdir MOUNT/littlefs
- cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) MOUNT/littlefs
- ls MOUNT/littlefs
- CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs QUIET=1
- &mbed-2
env: NAME=mbed2-NXP
install:
# Install dependencies
- export GCC_DIR=$HOME/gcc-arm-none-eabi-6-2017-q2-update
- export GCC_ARCHIVE=$HOME/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
- export GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2?revision=2cc92fb5-3e0e-402d-9197-bdfc8224d8a5?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,6-2017-q2-update
- if [ ! -e $GCC_DIR/bin/arm-none-eabi-gcc ]; then wget $GCC_URL -O $GCC_ARCHIVE; tar xfj $GCC_ARCHIVE -C $HOME; fi
- export PATH=$PATH:$GCC_DIR/bin
- pip install -r requirements.txt
# Print versions we use
- arm-none-eabi-gcc --version
- python --version
before_script:
# Create BUILD directory for tests
- mkdir BUILD
script:
# Run local mbed 2 testing
- python -u tools/build_travis.py --vendor "${NAME#mbed2-}"
- <<: *mbed-2
env: NAME=mbed2-STM
- <<: *mbed-2
env: NAME=mbed2-NORDIC
- <<: *mbed-2
env: NAME=mbed2-SILICON_LABS
- <<: *mbed-2
env: NAME=mbed2-MAXIM
- <<: *mbed-2
env: NAME=mbed2-ATMEL
- <<: *mbed-2
env: NAME=mbed2-NUVOTON
- <<: *mbed-2
env: NAME=mbed2-RENESAS
# Change python version here only because 3x the other jobs does not add any more coverage
python:
- '2.7'
- '3.5'
- '3.6'