From 4b7b5422dbb705ec0dab00cc18a8e915f8b334c0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 9 Feb 2017 13:51:30 +0000 Subject: [PATCH] Update the TravisCI environment to use Docker The Travis environment is terribly outdated, and they are not really subtly pushing people to use Docker to set up their own containerised CI environments instead of pulling from Ubuntu 12.04 or 14.04. Let's try using this approach: - create a Docker image that pulls from Debian Stretch - set up a build and test environment - push the image to the Docker Hub - create a derived Docker image that copies the Epoxy repo when running under Travis - run the build and test script inside the derived image This is similar to what Meson does for its CI. --- .travis.yml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5958dc..5ed10ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,22 @@ -language: c +sudo: false + +os: + - linux + compiler: - gcc - - clang - -sudo: false -addons: - apt: - packages: - - xutils-dev - - libgl1-mesa-dev - - libegl1-mesa-dev - - libgles1-mesa-dev - - libgles2-mesa-dev - - libgl1-mesa-dri +language: + - c -env: - global: - - DISPLAY=:99.0 +services: + - docker before_install: - - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x24" + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull ebassi/epoxyci ; fi script: - - NOCONFIGURE=1 ./autogen.sh - - mkdir _build && cd _build - - ../configure && make V=1 && make V=1 check + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo FROM ebassi/epoxyci > Dockerfile ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then echo ADD . /root >> Dockerfile ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t withgit . ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run withgit /bin/sh -c "cd /root && TRAVIS=true CC=$CC CXX=$CXX ./epoxy-run-tests.sh" ; fi