gitlab-ci: Consolidate pacman setup and cache downloaded pacman packages
authorJan Vesely <jano.vesely@gmail.com>
Sun, 5 May 2019 02:14:26 +0000 (22:14 -0400)
committerØyvind Kolås <pippin@gimp.org>
Sat, 25 May 2019 16:28:48 +0000 (18:28 +0200)
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
.gitlab-ci.yml

index bca1a798f2af3a7b09e86da557ff2d6bc983c63e..414fc1d661688630af156a7eb8b7e70ba2ceab86 100644 (file)
@@ -1,6 +1,15 @@
+cache:
+  paths:
+    - _pacman_cache
+
 .build:
   stage: build
   image: archlinux/base:latest
+  before_script:
+    - pacman -Syu --noconfirm --needed --cachedir `pwd`/_pacman_cache
+        base-devel
+        git
+        ${EXTRA_PKGS}
 
 .meson-build:
   extends: .build
@@ -48,39 +57,21 @@ latest-meson-lcms:
   extends: .meson-build
   variables:
     LCMS_OPTION : "-Dwith-lcms=true"
-  before_script:
-    - pacman -Syu --noconfirm --needed
-        base-devel
-        meson
-        lcms2
-        git
+    EXTRA_PKGS: "lcms2 meson"
 
 latest-meson-nolcms:
   extends: .meson-build
   variables:
     LCMS_OPTION : "-Dwith-lcms=false"
-  before_script:
-    - pacman -Syu --noconfirm --needed
-        base-devel
-        meson
-        lcms2
-        git
+    EXTRA_PKGS: "meson"
 
 latest-autotools-lcms:
   extends: .autotools-build
   variables:
     LCMS_OPTION : "--with-lcms"
-  before_script:
-    - pacman -Syu --noconfirm --needed
-        base-devel
-        lcms2
-        git
+    EXTRA_PKGS: "lcms2"
 
 latest-autotools-nolcms:
   extends: .autotools-build
   variables:
     LCMS_OPTION : "--without-lcms"
-  before_script:
-    - pacman -Syu --noconfirm --needed
-        base-devel
-        git