[pangomm/kjellahl/testci] CI: Add .gitlab-ci.yml



commit 98dd28e1da38df0ad621fe9a93ac42c67c36d8d1
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed Aug 25 16:11:24 2021 +0200

    CI: Add .gitlab-ci.yml

 .gitlab-ci.yml | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 158 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..c6fe2e7
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,158 @@
+image: ubuntu:devel
+
+stages:
+  - deps
+  - build
+  - deploy
+
+variables:
+  MESON_GCC_DEPS: g++
+                  gettext
+                  git
+                  yelp-tools
+                  gtk-doc-tools
+                  python3-pygments
+                  python3-setuptools
+                  libglib2.0-dev
+                  libcairo2-dev
+                  libpango1.0-dev
+                  mm-common
+                  libxml-libxml-perl
+                  meson
+                  ninja-build
+                  glib-networking
+  GIO_EXTRA_MODULES: "/usr/lib/x86_64-linux-gnu/gio/modules"
+  GIT_SUBMODULE_STRATEGY: normal
+
+.build_default:
+  before_script:
+    - export DEBIAN_FRONTEND=noninteractive
+    - apt update && apt -y upgrade && apt -y install $DEPENDENCIES
+
+# Clear the cache manually.
+clear_cache:
+  stage: deps
+  when: manual
+  script:
+    - echo Clearing the build-deps cache
+  cache:
+    key: build-deps
+    paths:
+      - libsigc/
+      - glibmm/
+      - cairomm/
+    policy: push
+
+build_deps:
+  extends: .build_default
+  stage: deps
+  variables:
+    DEPENDENCIES: $MESON_GCC_DEPS
+  script:
+    # Build and cache dependencies that can't be installed with apt.
+    # Build libsigc++3
+    - if test ! -d libsigc; then
+    - git clone --branch 3.0.7 --depth 1 https://github.com/libsigcplusplus/libsigcplusplus.git libsigc
+    - cd libsigc
+    - mkdir _build && cd _build
+    - meson --prefix=/usr --libdir=lib -Dwarnings=fatal -Dbuild-examples=false -Dbuildtype=release
+    - meson compile
+    - meson install
+    - cd ../..
+    - fi
+    # Build glibmm-2.68
+    - if test ! -d glibmm; then
+    - git clone --branch 2.68.1 --depth 1 https://gitlab.gnome.org/GNOME/glibmm.git glibmm
+    - cd glibmm
+    - mkdir _build && cd _build
+    - meson --prefix=/usr --libdir=lib -Dwarnings=fatal -Dbuild-examples=false -Dbuildtype=release
+    - meson compile
+    - cd ../..
+    - fi
+    # Build cairomm-1.16
+    - if test ! -d cairomm; then
+    - git clone --branch 1.16.1 --depth 1 https://gitlab.freedesktop.org/cairo/cairomm.git cairomm
+    - cd cairomm
+    - mkdir _build && cd _build
+    - meson --prefix=/usr --libdir=lib -Dwarnings=fatal -Dbuild-examples=false -Dbuild-tests=false 
-Dbuildtype=release
+    - meson compile
+    - cd ../..
+    - fi
+  cache:
+    key: build-deps
+    paths:
+      - libsigc/
+      - glibmm/
+      - cairomm/
+    policy: pull-push
+
+release_gcc_build:
+  extends: .build_default
+  stage: build
+  variables:
+    DEPENDENCIES: $MESON_GCC_DEPS
+  script:
+    - ninja -C libsigc/_build install
+    - ninja -C glibmm/_build install
+    - ninja -C cairomm/_build install
+    - mkdir _build && cd _build
+    # -Ddebug=false + -Doptimization=3 correspond to -Dbuildtype=release
+    - meson --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=fatal
+    - meson compile
+    - meson test
+    - meson install
+  cache:
+    key: build-deps
+    paths:
+      - libsigc/
+      - glibmm/
+      - cairomm/
+    policy: pull
+  artifacts:
+    when: always
+    paths:
+      - _build/docs/reference
+
+release_clang_build:
+  extends: .build_default
+  stage: build
+  variables:
+    DEPENDENCIES: $MESON_GCC_DEPS clang
+  script:
+    - ninja -C libsigc/_build install
+    - ninja -C glibmm/_build install
+    - ninja -C cairomm/_build install
+    - mkdir _build && cd _build
+    # -Ddebug=false + -Doptimization=3 correspond to -Dbuildtype=release
+    - CC=clang CXX=clang++ meson --prefix=/usr --libdir=lib -Ddebug=false -Doptimization=3 -Dwarnings=fatal
+    - meson compile
+    - meson test
+    - meson install
+  allow_failure: true
+  cache:
+    key: build-deps
+    paths:
+      - libsigc/
+      - glibmm/
+      - cairomm/
+    policy: pull
+  artifacts:
+    when: on_failure
+    paths:
+      - _build/meson-logs/testlog.txt
+      - _build/meson-logs/meson-log.txt
+    expire_in: 1 week
+
+# Publish reference documentation at gnome.pages.gitlab.gnome.org/pangomm
+pages:
+  stage: deploy
+  needs: [release_gcc_build]
+  script:
+    - mkdir public
+    - mv _build/docs/reference/html/* public
+  artifacts:
+    paths:
+      - public
+  only:
+    refs:
+      - master


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]