Add gitlab-ci support using a prebuilt docker image

This commit is contained in:
Christoph Reiter 2018-02-13 17:21:18 +01:00
parent 395550c671
commit dfc1f76be7
4 changed files with 88 additions and 0 deletions

18
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,18 @@
image: lazka/gitlab-gtk:v1
stages:
- build
before_script:
- mkdir -p _ccache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/_ccache
cache:
paths:
- _ccache/
build:
stage: build
script:
- bash -x ./.gitlab-ci/test-docker.sh

52
.gitlab-ci/Dockerfile Normal file
View File

@ -0,0 +1,52 @@
FROM fedora:27
RUN dnf -y install \
atk-devel \
at-spi2-atk-devel \
avahi-gobject-devel \
cairo-devel \
cairo-gobject-devel \
ccache \
colord-devel \
cups-devel \
fribidi-devel \
gcc \
gcc-c++ \
gdk-pixbuf2-devel \
gettext \
git \
glib2-devel \
gobject-introspection-devel \
graphene-devel \
itstool \
json-glib-devel \
libepoxy-devel \
libmount-devel \
libXcomposite-devel \
libXcursor-devel \
libXcursor-devel \
libXdamage-devel \
libXfixes-devel \
libXi-devel \
libXinerama-devel \
libxkbcommon-devel \
libXrandr-devel \
libXrender-devel \
mesa-libEGL-devel \
mesa-libwayland-egl-devel \
meson \
pango-devel \
redhat-rpm-config \
vulkan-devel \
wayland-devel \
wayland-protocols-devel \
xorg-x11-server-Xvfb
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

9
.gitlab-ci/run-docker.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "gitlab-gtk" \
--file "Dockerfile" .
sudo docker run --rm \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "gitlab-gtk" bash

9
.gitlab-ci/test-docker.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e
pwd
meson -Denable-x11-backend=true -Denable-wayland-backend=true \
-Denable-broadway-backend=true -Denable-vulkan=yes _build_full
cd _build_full
ninja