From 8e8a50d4ba80ed9797231ce97403e3c2530fff92 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Sat, 13 Jan 2018 09:17:31 -0500 Subject: [PATCH] testing: add travis Signed-off-by: Anas Nashif --- .travis.yml | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..472078fef4ec --- /dev/null +++ b/.travis.yml @@ -0,0 +1,60 @@ +language: minimal # setting language to C will override cross-compiler and fail + +compiler: + - gcc + - clang + +sudo: required +dist: trusty + +env: + global: + - ZEPHYR_GCC_VARIANT=zephyr + - ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk + - ZEPHYR_BASE=$TRAVIS_BUILD_DIR/deps/zephyr + - ZEPHYR_SDK_VERSION=0.9.2 + - ZEPHYR_SDK_DOWNLOAD_FOLDER=https://github.com/zephyrproject-rtos/meta-zephyr-sdk/releases/download/$ZEPHYR_SDK_VERSION + - ZEPHYR_SDK_SETUP_BINARY=zephyr-sdk-$ZEPHYR_SDK_VERSION-setup.run + - ZEPHYR_SDK_DOWNLOAD_URL=$ZEPHYR_SDK_DOWNLOAD_FOLDER/$ZEPHYR_SDK_SETUP_BINARY +matrix: + fast_finish: true + include: + - os: linux + env: TARGET="zephyr" + - os: osx + osx_image: xcode9.1 + env: TARGET="linux" + allow_failures: + - os: osx + +cache: + directories: + - $ZEPHYR_SDK_INSTALL_DIR + - /usr/local/bin + +before_install: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && + sudo apt-get update -qq && + sudo apt-get install libc6-dev-i386 make gperf gcc g++ python3-ply python3-yaml python3-pip device-tree-compiler ncurses-dev uglifyjs -qq && + sudo pip3 install pyelftools; + fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + brew update && + brew install python3 && + sudo pip3 install pyelftools; + fi + +install: > + if [[ "$TARGET" != "linux" && "$(cat $ZEPHYR_SDK_INSTALL_DIR/sdk_version)" != "$ZEPHYR_SDK_VERSION" ]]; then + wget $ZEPHYR_SDK_DOWNLOAD_URL && + chmod +x $ZEPHYR_SDK_SETUP_BINARY && + rm -rf $ZEPHYR_SDK_INSTALL_DIR && + ./$ZEPHYR_SDK_SETUP_BINARY --quiet -- -y -d $ZEPHYR_SDK_INSTALL_DIR > /dev/null; + fi + +before_script: > + source zephyr-env.sh + +script: > + ./scripts/sanitycheck -p qemu_x86