From 1e16d4f4830cc6fb1f11e9bb79f7dc4e9e63c70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 25 Mar 2020 15:01:43 +0000 Subject: [PATCH] gitlab: introduce use of ccache for speeding up rebuilds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For any given job there is a high likelihood that ccache will be able to reuse previously built object files. This will result in faster build pipelines in later updates. Reviewed-by: Erik Skultety Reviewed-by: Andrea Bolognani Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b70aa2367b..db504eef29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,15 @@ stages: # Default native build jobs that are always run .native_build_default_job_template: &native_build_default_job_definition stage: native_build + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" + before_script: + - mkdir -p ccache + - export CC="ccache gcc" + - export CCACHE_BASEDIR=${PWD} + - export CCACHE_DIR=${PWD}/ccache script: - mkdir build - cd build @@ -31,6 +40,15 @@ stages: # Default cross build jobs that are always run .cross_build_default_job_template: &cross_build_default_job_definition stage: cross_build + cache: + paths: + - ccache/ + key: "$CI_JOB_NAME" + before_script: + - mkdir -p ccache + - export CC="ccache ${ABI}-gcc" + - export CCACHE_BASEDIR=${PWD} + - export CCACHE_DIR=${PWD}/ccache script: - mkdir build - cd build