[gnome-build-meta/abderrahim/ci-improvements: 23/24] .gitlab-ci.yml: only cache sources for bst in track and build jobs



commit 428be50f05a37f3d73fe3d8abc0e2eb903f4c708
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Fri Apr 19 16:29:39 2019 +0100

    .gitlab-ci.yml: only cache sources for bst in track and build jobs
    
    Also use a different cache key per branch

 .gitlab-ci.yml | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 31fa63e4..6f708d6e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,14 +23,6 @@ stages:
   - reports
 
 
-# Store all the downloaded git and ostree repos in the cache.
-# This saves us fetching them on every build
-cache:
-  key: bst
-  paths:
-    - "${XDG_CACHE_HOME}/buildstream/sources/"
-
-
 before_script:
   # Use specific version of BuildStream
   - git clone https://gitlab.com/BuildStream/buildstream.git
@@ -86,6 +78,12 @@ before_script:
   dependencies: [track]
   script:
     - ${BST} -o arch "${ARCH}" build core.bst flatpak-runtimes.bst platform-manifest.bst sdk-manifest.bst
+  # Store all the downloaded git repos and tarballs in the cache.
+  # This saves us fetching them on every build
+  cache: &bst-cache
+    key: bst-$FLATPAK_BRANCH
+    paths:
+      - "${XDG_CACHE_HOME}/buildstream/sources/"
   # Store artifacts so we can inspect build failures
   artifacts:
     when: always
@@ -159,6 +157,7 @@ track:
   only:
     variables:
       - $FLATPAK_BRANCH == 'master'
+  cache: *bst-cache
   artifacts:
     when: always
     paths:


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