Skip to content

Commit

Permalink
Add Travis CI for Ubuntu 18.04, use docker run as Travis does not h…
Browse files Browse the repository at this point in the history
…ave Ubuntu 18.04 support directly.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
  • Loading branch information
yongtang committed Dec 18, 2018
1 parent 78f530d commit bf7087f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
24 changes: 18 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 20 additions & 0 deletions .travis/python.ubuntu.18.04.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bf7087f

Please sign in to comment.