summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml19
-rw-r--r--.gitlab-ci/Dockerfile20
-rwxr-xr-x.gitlab-ci/run-docker.sh9
3 files changed, 48 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..5f598b9b
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,19 @@
+image: ebassi/gitlab-gi:latest
+
+stages:
+ - build
+
+build-job:
+ stage: build
+ script:
+ - meson --prefix /usr --libdir /usr/lib64 --buildtype debug --werror -Dcairo=true _build .
+ - cd _build
+ - ninja
+ - meson test
+ except:
+ - tags
+ artifacts:
+ when: on_failure
+ name: "glib-_${CI_COMMIT_REF_NAME}"
+ paths:
+ - "${CI_PROJECT_DIR}/_build/meson-logs"
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
new file mode 100644
index 00000000..9a2fa757
--- /dev/null
+++ b/.gitlab-ci/Dockerfile
@@ -0,0 +1,20 @@
+FROM fedora:27
+
+RUN dnf -y install \
+ cairo-devel \
+ cairo-gobject-devel \
+ gcc \
+ gcc-c++ \
+ glib-devel \
+ itstool \
+ libffi-devel \
+ meson
+
+ARG HOST_USER_ID=5555
+ENV HOST_USER_ID ${HOST_USER_ID}
+RUN useradd -u $HOST_USER_ID -ms /bin/bash user
+
+USER user
+WORKDIR /home/user
+
+ENV LANG C.utf8
diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh
new file mode 100755
index 00000000..91694fb3
--- /dev/null
+++ b/.gitlab-ci/run-docker.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -e
+
+sudo docker build --build-arg HOST_USER_ID="$UID" --tag "gitlab-gi" \
+ --file "Dockerfile" .
+sudo docker run --rm \
+ --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
+ --tty --interactive "gitlab-gi" bash