[libgweather/ebassi/gtk4: 44/56] ci: Restructure the pipeline
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/ebassi/gtk4: 44/56] ci: Restructure the pipeline
- Date: Wed, 13 Oct 2021 12:02:16 +0000 (UTC)
commit 6041401f31af960144688f730faba54a57f9e111
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Oct 12 13:48:02 2021 +0100
ci: Restructure the pipeline
- Add base recipes to be reused for different jobs
- Split the ABI check into its own stage
- Build the API reference in its own stage
- Publish the API reference with GitLab Pages
.ci/check-abi | 3 +-
.gitlab-ci.yml | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 161 insertions(+), 7 deletions(-)
---
diff --git a/.ci/check-abi b/.ci/check-abi
index 6a0db45c..df629d8a 100755
--- a/.ci/check-abi
+++ b/.ci/check-abi
@@ -67,7 +67,8 @@ def build_install(revision):
subprocess.check_call(['meson', build_dir,
'--prefix=/usr', '--libdir=lib',
- '-Db_coverage=false', '-Dgtkdoc=false', '-Dtests=false'])
+ '-Db_coverage=false',
+ '-Dgtk_doc=false'])
subprocess.check_call(['ninja', '-v', '-C', build_dir])
subprocess.check_call(['ninja', '-v', '-C', build_dir, 'install'],
env={'DESTDIR': dest_dir})
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e6387602..1a5fec09 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,15 @@
variables:
- LAST_ABI_BREAK: f1f0bdd9ab47ff8ddba17e2125802c928226da64
-build-fedora:
+stages:
+ - build
+ - analysis
+ - docs
+ - deploy
+
+# Recipe for setting up the build
+# @PROJECT_DEPS: the dependencies of the project (on Fedora)
+# @MESON_VERSION: the version of Meson required by the project
+.build-setup:
image: fedora:latest
before_script:
# Undo delangification present in the Fedora Docker images
@@ -9,9 +17,154 @@ build-fedora:
- dnf reinstall -y glib2 glibc || dnf update -y glib2 glibc
# Add French locale support for tests
- dnf install -y glibc-langpack-fr
- - dnf install -y redhat-rpm-config meson libxml2-devel vala gettext itstool gtk3-devel
geocode-glib-devel gobject-introspection-devel libsoup-devel libabigail git python3-gobject pylint
+ - dnf install -y ${PROJECT_DEPS}
+ - pip3 install --user meson==${MESON_VERSION}
+ - export PATH="$PATH:$HOME/.local/bin"
+
+# Default build recipe
+# @PROJECT_DEPS: the dependencies of the project (on Fedora)
+# @MESON_VERSION: the version of Meson required by the project
+# @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation
+.build-default:
+ image: fedora:latest
+ before_script:
+ # Undo delangification present in the Fedora Docker images
+ - rm -f /etc/rpm/macros.image-language-conf
+ - dnf reinstall -y glib2 glibc || dnf update -y glib2 glibc
+ # Add French locale support for tests
+ - dnf install -y glibc-langpack-fr
+ - dnf install -y ${PROJECT_DEPS}
+ - pip3 install --user meson==${MESON_VERSION}
+ - export PATH="$PATH:$HOME/.local/bin"
script:
- - meson _build
- - ninja -C _build install
- - ninja -C _build test
+ - meson setup ${MESON_EXTRA_FLAGS} --prefix /usr _build .
+ - meson compile -C _build
+ - meson install -C _build
+ - meson test -C _build
+ artifacts:
+ when: always
+ name: "libgweather-${CI_COMMIT_REF_NAME}"
+ paths:
+ - "${CI_PROJECT_DIR}/_build/meson-logs"
+
+# Inherit to build the API reference via gi-docgen
+# @PROJECT_DEPS: the dependencies of the project (on Fedora)
+# @MESON_VERSION: the version of Meson required by the project
+# @MESON_EXTRA_FLAGS: extra arguments for the meson setup invocation
+# @DOCS_FLAGS: doc-related arguments for the meson setup invocation
+# @DOCS_PATH: the docs output directory under the build directory
+.gidocgen-build:
+ image: fedora:latest
+ before_script:
+ - export PATH="$HOME/.local/bin:$PATH"
+ - dnf install -y python3 python3-pip python3-wheel gobject-introspection-devel graphviz ninja-build
redhat-rpm-config
+ - dnf install -y ${PROJECT_DEPS}
+ - pip3 install --user meson==${MESON_VERSION} gi-docgen jinja2 Markdown markupsafe pygments toml
typogrify
+ script:
+ - meson setup ${MESON_EXTRA_FLAGS} ${DOCS_FLAGS} _docs .
+ - meson compile -C _docs
+ - |
+ pushd "_docs/${DOCS_PATH}" > /dev/null
+ tar cf ${CI_PROJECT_NAME}-docs.tar .
+ popd > /dev/null
+ - mv _docs/${DOCS_PATH}/${CI_PROJECT_NAME}-docs.tar .
+ artifacts:
+ when: always
+ name: 'Documentation'
+ expose_as: 'Download the API reference'
+ paths:
+ - ${CI_PROJECT_NAME}-docs.tar
+
+fedora-x86_64:
+ extends: .build-default
+ stage: build
+ needs: []
+ variables:
+ PROJECT_DEPS:
+ geocode-glib-devel
+ gettext
+ git
+ gobject-introspection-devel
+ gtk3-devel
+ itstool
+ libsoup-devel
+ libxml2-devel
+ ninja-build
+ pylint
+ python3
+ python3-gobject
+ python3-pip
+ python3-wheel
+ redhat-rpm-config
+ vala
+ MESON_VERSION: "0.55.3"
+ MESON_EXTRA_FLAGS: "--buildtype=debug -Dwerror=true -Dgtk_doc=false"
+
+abi-check:
+ extends: .build-setup
+ stage: analysis
+ needs: []
+ variables:
+ PROJECT_DEPS:
+ geocode-glib-devel
+ gettext
+ git
+ gobject-introspection-devel
+ gtk3-devel
+ itstool
+ libabigail
+ libsoup-devel
+ libxml2-devel
+ ninja-build
+ pylint
+ python3
+ python3-gobject
+ python3-pip
+ python3-wheel
+ redhat-rpm-config
+ vala
+ MESON_VERSION: "0.55.3"
+ LAST_ABI_BREAK: f1f0bdd9ab47ff8ddba17e2125802c928226da64
+ script:
+ - meson setup --prefix /usr -Dgtk_doc=false _build .
+ - meson compile -C _build
- ./.ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD)
+
+reference:
+ stage: docs
+ needs: []
+ extends: .gidocgen-build
+ variables:
+ PROJECT_DEPS:
+ geocode-glib-devel
+ gettext
+ git
+ gobject-introspection-devel
+ gtk3-devel
+ itstool
+ libsoup-devel
+ libxml2-devel
+ ninja-build
+ pylint
+ python3
+ python3-gobject
+ python3-pip
+ python3-wheel
+ redhat-rpm-config
+ vala
+ MESON_VERSION: "0.55.3"
+ DOCS_FLAGS: -Dgtk_doc=true
+ DOCS_PATH: doc/libgweather-3.0
+
+pages:
+ stage: deploy
+ needs: ['reference']
+ script:
+ - mkdir public && cd public
+ - tar xf ../${CI_PROJECT_NAME}-docs.tar
+ artifacts:
+ paths:
+ - public
+ only:
+ - master
+ - main
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]