diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..0f966f9da6 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +sudo: required + +language: python + +services: + - docker + +matrix: + include: + - os: linux + - os: osx + language: generic + + +install: ./script/travis/install + +script: + - ./script/travis/ci + - ./script/travis/build-binary diff --git a/script/build-osx b/script/build-osx index 15a7bbc541..042964e4be 100755 --- a/script/build-osx +++ b/script/build-osx @@ -3,7 +3,6 @@ set -ex PATH="/usr/local/bin:$PATH" -./script/clean rm -rf venv virtualenv -p /usr/local/bin/python venv diff --git a/script/prepare-osx b/script/prepare-osx index ca2776b641..10bbbecc3d 100755 --- a/script/prepare-osx +++ b/script/prepare-osx @@ -24,7 +24,7 @@ if !(which brew); then ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi -brew update +brew update > /dev/null if !(python_version | grep "$desired_python_version"); then if brew list | grep python; then diff --git a/script/travis/build-binary b/script/travis/build-binary new file mode 100755 index 0000000000..b3b7b925be --- /dev/null +++ b/script/travis/build-binary @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + script/build-linux + # TODO: add script/build-image +else + script/prepare-osx + script/build-osx +fi diff --git a/script/travis/ci b/script/travis/ci new file mode 100755 index 0000000000..4cce1bc844 --- /dev/null +++ b/script/travis/ci @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + tox -e py27,py34 -- tests/unit +else + # TODO: we could also install py34 and test against it + python -m tox -e py27 -- tests/unit +fi diff --git a/script/travis/install b/script/travis/install new file mode 100755 index 0000000000..a23667bffc --- /dev/null +++ b/script/travis/install @@ -0,0 +1,9 @@ +#!/bin/bash + +set -ex + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + pip install tox==2.1.1 +else + pip install --user tox==2.1.1 +fi