[gdk-pixbuf] Prepare for GitLab CI
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] Prepare for GitLab CI
- Date: Mon, 30 Apr 2018 17:17:52 +0000 (UTC)
commit d15ba94b2ebfbec6198353352e1b85afdbb1d8e8
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Apr 26 12:16:30 2018 +0100
Prepare for GitLab CI
Once we migrate GdkPixbuf over to GitLab, we should already have all the
required bits in place for running a continuous integration pipeline.
.gitlab-ci.yml | 20 ++++++++++++++++++++
.gitlab/ci/Dockerfile | 34 ++++++++++++++++++++++++++++++++++
.gitlab/ci/run-docker.sh | 11 +++++++++++
.gitlab/ci/test-docker.sh | 21 +++++++++++++++++++++
4 files changed, 86 insertions(+), 0 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..2c3d8db
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,20 @@
+stages:
+ - build
+
+.cache-paths: &cache-paths
+ paths:
+ - _ccache/
+
+meson-fedora-x86_64:
+ image: registry.gitlab.gnome.org/gnome/gdk-pixbuf/master:v1
+ stage: build
+ script:
+ - bash -x ./.gitlab/ci/test-docker.sh
+ artifacts:
+ when: on_failure
+ name: "gdk-pixbuf-${CI_COMMIT_REF_NAME}"
+ paths:
+ - "${CI_PROJECT_DIR}/_build/meson-logs"
+ cache:
+ key: "$CI_JOB_NAME"
+ <<: *cache-paths
diff --git a/.gitlab/ci/Dockerfile b/.gitlab/ci/Dockerfile
new file mode 100644
index 0000000..82d583f
--- /dev/null
+++ b/.gitlab/ci/Dockerfile
@@ -0,0 +1,34 @@
+FROM fedora:28
+
+RUN dnf -y install \
+ ccache \
+ gcc \
+ gcc-c++ \
+ gettext \
+ gettext-devel \
+ git \
+ glib2-devel \
+ gobject-introspection-devel \
+ gtk-doc \
+ itstool \
+ jasper-devel \
+ libjpeg-turbo-devel \
+ libpng-devel \
+ libtiff-devel \
+ libX11-devel \
+ make \
+ meson \
+ redhat-rpm-config \
+ shared-mime-info \
+ && dnf clean all
+
+RUN pip3 install 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.UTF-8
diff --git a/.gitlab/ci/run-docker.sh b/.gitlab/ci/run-docker.sh
new file mode 100755
index 0000000..02d265a
--- /dev/null
+++ b/.gitlab/ci/run-docker.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e
+
+TAG="registry.gitlab.gnome.org/gnome/gdk-pixbuf/master:v1"
+
+sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
+ --file "Dockerfile" .
+sudo docker run --rm --security-opt label=disable \
+ --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
+ --tty --interactive "${TAG}" bash
diff --git a/.gitlab/ci/test-docker.sh b/.gitlab/ci/test-docker.sh
new file mode 100755
index 0000000..53cac9d
--- /dev/null
+++ b/.gitlab/ci/test-docker.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+
+srcdir=$(pwd)
+
+mkdir -p _ccache
+export CCACHE_BASEDIR="$(pwd)"
+export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
+
+ccache --zero-stats
+ccache --show-stats
+export CCACHE_DISABLE=true
+meson \
+ _build $srcdir
+unset CCACHE_DISABLE
+
+cd _build
+
+ninja
+ccache --show-stats
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]