[atkmm/kjellahl/testci] Add .gitlab-ci.yml



commit bf52c0f130e852491be0f046b0f1d6ed9d479317
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed Aug 25 09:00:51 2021 +0200

    Add .gitlab-ci.yml

 .gitlab-ci.yml | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 141 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..3cffef1
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,141 @@
+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
+                  libatk1.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_cache:
+  stage: deps
+  when: manual
+  script:
+    - ls -l
+  cache:
+    key: build-deps
+    paths:
+      - libsigc/
+      - glibmm/
+    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++
+    - ls -l
+    - 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
+    - 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
+  cache:
+    key: build-deps
+    paths:
+      - libsigc/
+      - glibmm/
+    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
+    - 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/
+    policy: pull
+  artifacts:
+    when: always
+    paths:
+      - _build/doc/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
+    - 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/
+    policy: pull
+  artifacts:
+    when: on_failure
+    paths:
+      - _build/meson-logs/testlog.txt
+      - _build/meson-logs/meson-log.txt
+    expire_in: 1 week
+
+pages:
+  stage: deploy
+  needs: [release_gcc_build]
+  script:
+    - mkdir public
+    - mv _build/doc/reference/html/* public
+  artifacts:
+    paths:
+      - public
+  only:
+    refs:
+      - master


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