[PATCH 1/1] gitlab-ci: add cache to decrease build times

Q. Gylstorff Quirin.Gylstorff at siemens.com
Wed Sep 30 12:51:46 CEST 2020


From: Quirin Gylstorff <quirin.gylstorff at siemens.com>

Add the variable CCACHE_DIR to the build to move the ccache from ~/.ccache
to the current directory and upload the cache from each build.

Each job uses a separate cache.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff at siemens.com>
---
 .gitlab-ci.yml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 59bd1d355..fa0795acd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,6 +18,7 @@ variables:
   GIT_STRATEGY: clone
   KDIR: "/tmp/kernel"
   USE_CCACHE: "1"
+  CCACHE_DIR: "./.ccache"
   CCACHE_MAXSIZE: "400M"
   IPIPE_MIRROR_URL: "https://gitlab.denx.de/Xenomai"
   PACKAGES: "gcc-8 gcc-8-aarch64-linux-gnu libc6-dev-arm64-cross \
@@ -162,7 +163,10 @@ variables:
     - ./configure --enable-smp ${CONFIGURE_OPTS}
     - make -j $(nproc)
     - ccache -s
-
+  cache:
+    key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
+    paths:
+      - $CCACHE_DIR
 
 arm-4.19-release:
   extends: .build
-- 
2.20.1




More information about the Xenomai mailing list