mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
ci: Add GitLab CI description file
We're mostly interested into building and testing everything that gets pushed to the repository — including merge requests. When pushing tags, though, we should assume we're spinning a release, so let's run the dist target, and store the tarball, and the generated documentation while we're at it, as artifacts on GitLab. The Dockerfile for the image used for the build is included in tree, and published on Docker Hub. Using a custom image allows us to avoid the costly "download and install build dependencies" phase, as well as controlling the environment a little bit better. https://bugzilla.gnome.org/show_bug.cgi?id=793635
This commit is contained in:
parent
8bfedb57cc
commit
e04d2e81fc
38
.gitlab-ci.yml
Normal file
38
.gitlab-ci.yml
Normal file
@ -0,0 +1,38 @@
|
||||
image: ebassi/gitlab-glib:latest
|
||||
|
||||
stages:
|
||||
- build
|
||||
|
||||
build-job:
|
||||
stage: build
|
||||
script:
|
||||
- meson --prefix /usr --libdir /usr/lib64 --buildtype debug --werror -Dsystemtap=true -Ddtrace=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"
|
||||
|
||||
dist-job:
|
||||
stage: build
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- meson --prefix /usr --libdir /usr/lib64 --buildtype release -Dgtk_doc=true -Dman=true _build .
|
||||
- cd _build
|
||||
- ninja dist
|
||||
- ninja glib-doc
|
||||
- tar -c -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
|
||||
- tar -c -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
|
||||
- tar -c -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
|
||||
artifacts:
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/glib-docs.tar.xz"
|
||||
- "${CI_PROJECT_DIR}/_build/gobject-docs.tar.xz"
|
||||
- "${CI_PROJECT_DIR}/_build/gio-docs.tar.xz"
|
||||
- "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"
|
31
.gitlab-ci/Dockerfile
Normal file
31
.gitlab-ci/Dockerfile
Normal file
@ -0,0 +1,31 @@
|
||||
FROM fedora:27
|
||||
|
||||
RUN dnf -y install \
|
||||
desktop-file-utils \
|
||||
elfutils-libelf-devel \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
gettext \
|
||||
git \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
gtk-doc \
|
||||
itstool \
|
||||
libattr-devel \
|
||||
libffi-devel \
|
||||
libmount-devel \
|
||||
libselinux-devel \
|
||||
libxslt \
|
||||
meson \
|
||||
pcre-devel \
|
||||
systemtap-sdt-devel \
|
||||
zlib-devel
|
||||
|
||||
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
9
.gitlab-ci/run-docker.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "gitlab-glib" \
|
||||
--file "Dockerfile" .
|
||||
sudo docker run --rm \
|
||||
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
|
||||
--tty --interactive "gitlab-glib" bash
|
Loading…
Reference in New Issue
Block a user