summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2017-12-22 16:34:53 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-01-10 17:45:22 +0100
commitadf5e51ccf9d9dbf938c0da496e0d4d81d3284f6 (patch)
tree5eb2bf57dc56c0e2f425ed6eecd0a2136e108e52
parent661e64ce6091724b86a934268daa2c80bda46eb5 (diff)
downloadpygobject-adf5e51ccf9d9dbf938c0da496e0d4d81d3284f6.tar.gz
Add gitlab CI tests
Adds a Dockerfile which is available on the docker hub and gets used by the gitlab test runner. The tests get executed in an Ubuntu 17.04 image for various Python versions and consist of building, testing, code quality testing and documentation build testing.
-rw-r--r--.gitlab-ci.yml22
-rw-r--r--.gitlab-ci/Dockerfile32
-rw-r--r--.gitlab-ci/README.rst1
-rwxr-xr-x.gitlab-ci/test-docker.sh30
4 files changed, 85 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..5408a38f
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,22 @@
+services:
+ - docker
+
+image: lazka/pygobject:latest
+
+.defaults: &defaults
+ variables:
+ PYTHON: "$CI_JOB_NAME"
+ script:
+ - bash -x ./.gitlab-ci/test-docker.sh
+
+python2.7:
+ <<: *defaults
+
+python3.4:
+ <<: *defaults
+
+python3.5:
+ <<: *defaults
+
+python3.6:
+ <<: *defaults
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
new file mode 100644
index 00000000..3943383c
--- /dev/null
+++ b/.gitlab-ci/Dockerfile
@@ -0,0 +1,32 @@
+FROM ubuntu:zesty
+
+ENV LANG C.UTF-8
+ENV PYTHONDONTWRITEBYTECODE 1
+ENV CI true
+
+RUN apt-get update
+RUN apt-get install -y dirmngr
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F23C5A6CF475977595C89F51BA6932366A755776
+RUN echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" >> /etc/apt/sources.list
+RUN apt-get update
+
+RUN apt-get install -y \
+ autoconf-archive \
+ libglib2.0-dev \
+ libcairo2-dev \
+ virtualenv \
+ git \
+ python2.7-dev \
+ python3.4-dev \
+ python3.5-dev \
+ python3.6-dev \
+ libtool \
+ libffi-dev \
+ gobject-introspection \
+ libgirepository1.0-dev \
+ libgtk-3-0 \
+ gir1.2-gtk-3.0 \
+ dbus \
+ xauth \
+ xvfb \
+ locales
diff --git a/.gitlab-ci/README.rst b/.gitlab-ci/README.rst
new file mode 100644
index 00000000..107abf0e
--- /dev/null
+++ b/.gitlab-ci/README.rst
@@ -0,0 +1 @@
+The Dockerfile is available at https://hub.docker.com/r/lazka/pygobject/
diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh
new file mode 100755
index 00000000..60a25761
--- /dev/null
+++ b/.gitlab-ci/test-docker.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+set -e
+
+virtualenv --python="${PYTHON}" /tmp/venv
+source /tmp/venv/bin/activate
+
+python -m pip install git+https://github.com/pygobject/pycairo.git
+python -m pip install pyflakes pycodestyle
+
+export PKG_CONFIG_PATH=/tmp/venv/share/pkgconfig
+export MALLOC_CHECK_=3
+export MALLOC_PERTURB_=$((${RANDOM} % 255 + 1))
+PYVER=$(python -c "import sys; sys.stdout.write(str(sys.version_info[0]))")
+
+# BUILD
+./autogen.sh --with-python=python
+make
+
+# TESTS
+xvfb-run -a make check
+
+# CODE QUALITY CHECKS
+make check.quality
+
+# DOCUMENTATION CHECKS
+if [[ "${PYVER}" == "2" ]]; then
+ python -m pip install sphinx sphinx_rtd_theme
+ python -m sphinx -W -a -E -b html -n docs docs/_build
+fi;