diff --git a/.travis.yml b/.travis.yml index 2b32af683f..21de0273d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,42 +14,54 @@ before_script: matrix: include: - - language: python + - name: "Ubuntu 14.04 Python 2.7" + language: python python: - 2.7 before_install: - bash -x ${TRAVIS_BUILD_DIR}/.travis/python.configure.sh script: - bazel test -s --verbose_failures -- //tensorflow_io/... -//tensorflow_io/ignite:ignite_py_test -//tensorflow_io/video:video_py_test - - language: python + - name: "Ubuntu 14.04 Python 3.4" + language: python python: - 3.4 before_install: - bash -x ${TRAVIS_BUILD_DIR}/.travis/python.configure.sh script: - bazel test -s --verbose_failures -- //tensorflow_io/... -//tensorflow_io/ignite:ignite_py_test -//tensorflow_io/video:video_py_test - - language: python + - name: "Ubuntu 14.04 Python 3.5" + language: python python: - 3.5 before_install: - bash -x ${TRAVIS_BUILD_DIR}/.travis/python.configure.sh script: - bazel test -s --verbose_failures -- //tensorflow_io/... -//tensorflow_io/ignite:ignite_py_test -//tensorflow_io/video:video_py_test - - language: python + - name: "Ubuntu 14.04 Python 3.6" + language: python python: - 3.6 before_install: - bash -x ${TRAVIS_BUILD_DIR}/.travis/python.configure.sh script: - bazel test -s --verbose_failures -- //tensorflow_io/... -//tensorflow_io/ignite:ignite_py_test -//tensorflow_io/video:video_py_test - - language: r + - name: "Ubuntu 18.04 Python 2.7" + script: + - docker run -i -t -e PYTHON_VERSION= -e BAZEL_VERSION=0.20.0 -e BAZEL_OS=linux --rm -v $PWD:/workspace -w /workspace --net=host ubuntu:18.04 bash -x -c ".travis/python.ubuntu.18.04.sh && apt-get -y -qq install libavformat57 libavcodec57 libavutil55 libswscale4 && bazel test -s --verbose_failures -- //tensorflow_io/... -//tensorflow_io/ignite:ignite_py_test" + - name: "Ubuntu 18.04 Python 3.6" + script: + - docker run -i -t -e PYTHON_VERSION=3 -e BAZEL_VERSION=0.20.0 -e BAZEL_OS=linux --rm -v $PWD:/workspace -w /workspace --net=host ubuntu:18.04 bash -x -c ".travis/python.ubuntu.18.04.sh && apt-get -y -qq install libavformat57 libavcodec57 libavutil55 libswscale4 && bazel test -s --verbose_failures -- //tensorflow_io/... -//tensorflow_io/ignite:ignite_py_test" + - name: "Ubuntu 14.04 R 3.2" + language: r r: - 3.2 before_install: - cd R-package script: - R -e "devtools::test()" - - language: r + - name: "Ubuntu 14.04 R 3.5" + language: r r: - 3.5 before_install: diff --git a/.travis/python.ubuntu.18.04.sh b/.travis/python.ubuntu.18.04.sh new file mode 100755 index 0000000000..c498336489 --- /dev/null +++ b/.travis/python.ubuntu.18.04.sh @@ -0,0 +1,20 @@ +set -x -e + +# Test on Travis inside Ubuntu18.04 docker image +apt-get -y -qq update +apt-get -y -qq install python${PYTHON_VERSION}-pip curl wget unzip make +if [[ "" != "${PYTHON_VERSION}" ]]; then + ln -s /usr/bin/python${PYTHON_VERSION} /usr/bin/python + ln -s /usr/bin/pip${PYTHON_VERSION} /usr/bin/pip +fi +# Show gcc and python version in Travis CI +gcc -v +python --version +# Install bazel +URL="https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh" +wget -O install.sh "${URL}" +chmod +x install.sh +./install.sh +rm -f install.sh +# Configure TensorFlow +./configure.sh diff --git a/configure.sh b/configure.sh index 45e8f4e56a..5c95dd22a9 100755 --- a/configure.sh +++ b/configure.sh @@ -21,7 +21,7 @@ function write_action_env_to_bazelrc() { write_to_bazelrc "build --action_env $1=\"$2\"" } -rm .bazelrc +rm -f .bazelrc if python -c "import tensorflow" &> /dev/null; then echo 'using installed tensorflow' else