glib/.gitlab-ci.yml
Emmanuele Bassi e04d2e81fc 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
2018-02-20 13:49:21 +00:00

39 lines
1.1 KiB
YAML

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"