[gimp] refactoring of the gitlab-ci.yml



commit 699b3c5c029b003f065000aecaafbe47a8e0adb5
Author: Félix Piédallu <felix piedallu me>
Date:   Wed Aug 21 13:54:38 2019 +0200

    refactoring of the gitlab-ci.yml

 .gitlab-ci.yml | 165 +++++++++++++++++++++++++--------------------------------
 1 file changed, 71 insertions(+), 94 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cb298031cc..7024f23e44 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,5 @@
+image: archlinux/base:latest
+
 stages:
   - babl
   - gegl
@@ -5,48 +7,49 @@ stages:
 
 variables:
   INSTALL_DIR: "_install"
-  INSTALL_PREFIX: "$CI_PROJECT_DIR/$INSTALL_DIR"
+  INSTALL_PREFIX: "${CI_PROJECT_DIR}/${INSTALL_DIR}"
+  PACMAN_CACHE:   "${CI_PROJECT_DIR}/_pacman_cache"
 
 cache:
   paths:
   - _pacman_cache
 
-image: archlinux/base:latest
-
 .babl-base:
   stage: babl
   artifacts:
     paths:
-    - $INSTALL_DIR
+    - "${INSTALL_DIR}"
   variables:
     GIT_DEPTH: "5"
   before_script:
-    - pacman -Syu --noconfirm --needed --cachedir `pwd`/_pacman_cache
+    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig"
+    - export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}"
+    - export XDG_DATA_DIRS="${INSTALL_PREFIX}/share:/usr/local/share:/usr/share"
+    - pacman -Syu --noconfirm --needed --cachedir "${PACMAN_CACHE}"
         git
         base-devel
         gobject-introspection
         meson
         lcms2
-    - git clone --depth=$GIT_DEPTH https://gitlab.gnome.org/GNOME/babl.git _babl
-    - cd _babl
-    - mkdir _build
+    - git clone --depth="${GIT_DEPTH}" https://gitlab.gnome.org/GNOME/babl.git _babl
 
-babl-git-meson:
+babl-git:
   extends: .babl-base
-  variables:
-    GIT_STRATEGY: none
   script:
-    - meson -Dprefix="$INSTALL_PREFIX" _build
+    - cd _babl
+    - meson -Dprefix="${INSTALL_PREFIX}" _build
     - ninja -C _build
     - ninja -C _build install
 
-# babl-min-meson:
+# babl-min:
 #   extends: .babl-base
 #   script:
-#     - grep babl_required_version ../configure.ac | grep -o '[0-9]*\.[0-9]*\.[0-9]*' | sed 's/\./_/g' > 
.babl_min_version
-#     - git fetch --no-tags origin "refs/tags/BABL_`cat .babl_min_version`:refs/tags/MIN_VERSION"
+#     - BABL_MIN_VERSION="$(grep babl meson.build | grep version
+#         | grep -o '[0-9]*\.[0-9]*\.[0-9]*' | sed 's/\./_/g')"
+#     - cd _babl
+#     - git fetch --no-tags origin "refs/tags/BABL_${BABL_MIN_VERSION}:refs/tags/MIN_VERSION"
 #     - git checkout MIN_VERSION
-#     - meson -Dprefix="$INSTALL_PREFIX" _build
+#     - meson -Dprefix="${INSTALL_PREFIX}" _build
 #     - ninja -C _build
 #     - ninja -C _build install
 
@@ -54,11 +57,14 @@ babl-git-meson:
   stage: gegl
   artifacts:
     paths:
-    - $INSTALL_DIR
+    - "${INSTALL_DIR}"
   variables:
     GIT_DEPTH: "5"
   before_script:
-    - pacman -Syu --noconfirm --needed --cachedir `pwd`/_pacman_cache
+    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig"
+    - export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}"
+    - export XDG_DATA_DIRS="${INSTALL_PREFIX}/share:/usr/local/share:/usr/share"
+    - pacman -Syu --noconfirm --needed --cachedir "${PACMAN_CACHE}"
         git
         base-devel
         meson
@@ -80,34 +86,42 @@ babl-git-meson:
         python
         sdl2
         suitesparse
-    - git clone --depth=$GIT_DEPTH https://gitlab.gnome.org/GNOME/gegl.git _gegl
-    - cd _gegl
-    - mkdir _build
+    - git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git _gegl
 
-gegl-git-meson:
+gegl-git:
   extends: .gegl-base
-  variables:
-    GIT_STRATEGY: none
   script:
-    - export PKG_CONFIG_PATH="$INSTALL_PREFIX/lib/pkgconfig"
-    - export LD_LIBRARY_PATH="$INSTALL_PREFIX/lib:$LD_LIBRARY_PATH"
-    - export XDG_DATA_DIRS="$INSTALL_PREFIX/share:$XDG_DATA_DIRS"
-    - meson -Dprefix="$INSTALL_PREFIX" _build
+    - cd _gegl
+    - meson --prefix="${INSTALL_PREFIX}" _build
     - ninja -C _build
     - ninja -C _build install
 
+# gegl-min:
+#   extends: .gegl-base
+#   script:
+#     - GEGL_MIN_VERSION="$(grep gegl meson.build | grep version
+#         | grep -o '[0-9]*\.[0-9]*\.[0-9]*' | sed 's/\./_/g')"
+#     - cd _gegl
+#     - git fetch --no-tags origin "refs/tags/GEGL_${GEGL_MIN_VERSION}:refs/tags/MIN_VERSION"
+#     - git checkout MIN_VERSION
+#     - meson -Dprefix="${INSTALL_PREFIX}" _build
+#     - ninja -C _build
+#     - ninja -C _build install
+
 .gimp-base:
   stage: gimp
   artifacts:
     paths:
-    - $INSTALL_DIR
+    - "${INSTALL_DIR}"
   variables:
     GIT_DEPTH: "5"
   before_script:
-    - pacman -Syu --noconfirm --needed --cachedir `pwd`/_pacman_cache
+    - export PKG_CONFIG_PATH="${INSTALL_PREFIX}/lib/pkgconfig"
+    - export LD_LIBRARY_PATH="${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}"
+    - export XDG_DATA_DIRS="${INSTALL_PREFIX}/share:/usr/local/share:/usr/share"
+    - pacman -Syu --noconfirm --needed --cachedir "${PACMAN_CACHE}"
         git
         base-devel
-        meson
         appstream-glib
         at-spi2-core
         at-spi2-atk
@@ -141,80 +155,43 @@ gegl-git-meson:
         intltool
         iso-codes
         xorg-server-xvfb
-    - git clone --depth=$GIT_DEPTH https://gitlab.gnome.org/GNOME/gimp.git _gimp
-    - cd _gimp
-    - mkdir _build
 
-.build-gimp:
+.gimp-autotools:
   extends: .gimp-base
-  variables:
-    GIT_STRATEGY: none
   script:
+    - mkdir _build
     - cd _build
-    - LIBMYPAINT_CFLAGS="-I/usr/include/libmypaint-1.3 -I/usr/include/json-c" LIBMYPAINT_LIBS="-lmypaint-1.3 
-ljson-c" PKG_CONFIG_PATH="$INSTALL_PREFIX/lib/pkgconfig" ../autogen.sh --prefix="$INSTALL_PREFIX" 
$CONFIG_OPTIONS --with-python=force --with-javascript=force --with-lua=force
-    - LD_LIBRARY_PATH="$INSTALL_PREFIX/lib:$LD_LIBRARY_PATH" make -j `nproc`
-#    - LD_LIBRARY_PATH="$INSTALL_PREFIX/lib:$LD_LIBRARY_PATH" make check
+    - LIBMYPAINT_CFLAGS="-I/usr/include/libmypaint-1.3 -I/usr/include/json-c"
+      LIBMYPAINT_LIBS="-lmypaint-1.3 -ljson-c"
+      ../autogen.sh
+        --prefix="${INSTALL_PREFIX}"
+        --enable-debug
+        --with-python=force
+        --with-javascript=force
+        --with-lua=force
+    - make -j "$(nproc)"
+    # - make check
   artifacts:
-    name: "app-tests-logs-$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
+    name: "app-tests-logs-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
     when: on_failure
     expire_in: 1 week
     paths:
-      - _gimp/_build/app/tests/
-
-# .build-default:
-#   extends: .build-gimp
-#   variables:
-#     CONFIG_OPTIONS: ""
-
-.build-all:
-  extends: .build-gimp
-  variables:
-    CONFIG_OPTIONS: "--enable-debug"
-
-# build-default-git-autotools:
-#   extends: .build-default
-#   dependencies:
-#     - babl-git-autotools
-#     - gegl-git-autotools
+      - _build/app/tests/
 
-# build-default-git-meson:
-#   extends: .build-default
-#   dependencies:
-#     - babl-git-meson
-#     - gegl-git-meson
-
-# build-default-min-autotools:
-#   extends: .build-default
-#   dependencies:
-#     - babl-min-autotools
-#     - gegl-min-autotools
-
-# build-default-min-meson:
-#   extends: .build-default
-#   dependencies:
-#     - babl-min-meson
-#     - gegl-min-meson
-
-build-all-git:
-  extends: .build-all
+build-git-autotools:
+  extends: .gimp-autotools
   dependencies:
-    - babl-git-meson
-    - gegl-git-meson
-
-# build-all-git-meson:
-#   extends: .build-all
-#   dependencies:
-#     - babl-git-meson
-#     - gegl-git-meson
+    - babl-git
+    - gegl-git
 
-# build-all-min-autotools:
-#   extends: .build-all
+# build-min-autotools:
+#   extends: .gimp-autotools
 #   dependencies:
-#     - babl-min-autotools
-#     - gegl-min-autotools
+#     - babl-git
+#     - gegl-git
 
-# build-all-min-meson:
-#   extends: .build-all
+# build-min-meson:
+#   extends: .gimp-meson
 #   dependencies:
-#     - babl-min-meson
-#     - gegl-min-meson
+#     - babl-min
+#     - gegl-min


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