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



commit 9d599c5ddcae1f8e235bed244556ec6d8b5b2dcf
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Aug 26 15:14:43 2021 +0200

    CI: Add .gitlab-ci.yml

 .gitlab-ci.yml | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 175 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..7feb2554
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,175 @@
+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
+                  libgtk-4-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
+    - meson install
+    - 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
+    - meson install
+    - cd ../..
+    - fi
+    # Build pangomm-2.48
+    - if test ! -d pangomm; then
+    - git clone --branch 2.49.1 --depth 1 https://gitlab.gnome.org/GNOME/pangomm.git pangomm
+    - cd pangomm
+    - mkdir _build && cd _build
+    - meson --prefix=/usr --libdir=lib -Dwarnings=fatal -Dbuildtype=release
+    - meson compile
+    - cd ../..
+    - fi
+  cache:
+    key: build-deps
+    paths:
+      - libsigc/
+      - glibmm/
+      - cairomm/
+      - pangomm/
+    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
+    - ninja -C pangomm/_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/
+      - pangomm/
+    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
+    - ninja -C pangomm/_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/
+      - pangomm/
+    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/gtkmm
+pages:
+  stage: deploy
+  needs: [release_gcc_build]
+  script:
+    - mkdir public
+    - mv _build/docs/reference/html/* public
+  artifacts:
+    paths:
+      - public
+  only:
+    refs:
+      - kjellahl/testci


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