aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-02-04 08:52:45 +0100
committerGuido Günther <agx@sigxcpu.org>2017-02-04 08:52:45 +0100
commit3aeeb059230fc068b69217b4a7af0d80d23528a0 (patch)
treefd78a9ddb4cfeb107776dc919a54c817bca3f19a
parentdc96012abcd81667d24fdefba481df53af6e6f32 (diff)
Run tests via travis ci
to prevent breackag as in issue #1.
-rw-r--r--.travis.yml9
-rwxr-xr-xtests/helpers/run-in-docker30
2 files changed, 39 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..b4beba5
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,9 @@
+---
+sudo: required
+language: C
+
+services:
+ - docker
+
+script:
+ - tests/helpers/run-in-docker
diff --git a/tests/helpers/run-in-docker b/tests/helpers/run-in-docker
new file mode 100755
index 0000000..38424fd
--- /dev/null
+++ b/tests/helpers/run-in-docker
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -eu
+
+PROJECT=libplanfahr
+DEPS="libsoup2.4-dev libglib2.0-dev libxml2-dev gnome-common gtk-doc-tools libgirepository1.0-dev"
+SUITE=jessie
+
+echo $(pwd)
+cat >Dockerfile <<EOF
+FROM debian:$SUITE
+ENV DEBIAN_FRONTEND=noninteractive
+RUN echo "deb http://ftp.de.debian.org/debian sid main" > /etc/apt/sources.list
+RUN apt-get update && apt-get dist-upgrade --yes
+RUN apt-get install -y --no-install-recommends $DEPS
+
+WORKDIR /$PROJECT
+COPY . .
+CMD ./autogen.sh && ./configure && make && make check
+EOF
+
+CIDFILE="$(mktemp --dry-run)"
+TAG="$PROJECT/$SUITE"
+echo "Building Docker image ${TAG}"
+docker build . --tag=${TAG}
+docker run --cidfile=${CIDFILE} ${TAG}
+
+docker rm "$(cat ${CIDFILE})" >/dev/null
+rm -f "${CIDFILE}"
+