diff --git a/.travis.yml b/.travis.yml index 01e47b1..f6f50e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,6 @@ before_script: - docker build -t withgit . script: - - docker run withgit /bin/sh -c "cd /root && CC=$CC ./epoxy-run-tests.sh" - - docker run withgit /bin/sh -c "cd /root && CC=$CC ./epoxy-run-tests.sh -Denable-glx=no" - - docker run withgit /bin/sh -c "cd /root && CC=$CC ./epoxy-run-tests.sh -Denable-egl=no" + - docker run withgit /bin/sh -c "CC=$CC ./epoxy-run-tests.sh" + - docker run withgit /bin/sh -c "CC=$CC ./epoxy-run-tests.sh -Denable-glx=no" + - docker run withgit /bin/sh -c "CC=$CC ./epoxy-run-tests.sh -Denable-egl=no" diff --git a/.travis/Dockerfile b/.travis/Dockerfile new file mode 100644 index 0000000..1764fd9 --- /dev/null +++ b/.travis/Dockerfile @@ -0,0 +1,31 @@ +FROM debian:stretch-slim +MAINTAINER Emmanuele Bassi + +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -qq -y \ + ca-certificates \ + clang \ + gcc \ + libgl1-mesa-dev \ + libegl1-mesa-dev \ + libgles1-mesa-dev \ + libgles2-mesa-dev \ + libgl1-mesa-dri \ + locales \ + ninja-build \ + pkg-config \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + xvfb && \ + rm -rf /usr/share/doc/* /usr/share/man/* + +RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8 +ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 + +RUN pip3 install meson + +WORKDIR /root + +COPY epoxy-run-tests.sh . diff --git a/.travis/epoxy-run-tests.sh b/.travis/epoxy-run-tests.sh new file mode 100755 index 0000000..52f01ea --- /dev/null +++ b/.travis/epoxy-run-tests.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Start Xvfb +XVFB_WHD=${XVFB_WHD:-1280x720x16} + +Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp & +xvfb=$! + +export DISPLAY=:99 + +mkdir _build + +meson --prefix /usr "$@" _build . || exit $? +ninja -C _build || exit $? +meson test -C _build || exit $? + +rm -rf _build + +# Stop Xvfb +kill -9 ${xvfb} diff --git a/.travis/run-docker.sh b/.travis/run-docker.sh new file mode 100755 index 0000000..4b3ecc7 --- /dev/null +++ b/.travis/run-docker.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -xe + +srcdir="$(pwd)/.." + +sudo docker build \ + --tag "epoxyci" \ + --file "Dockerfile" . +sudo docker run --rm \ + --volume "${srcdir}:/root/epoxy" \ + --tty --interactive "epoxyci" bash