From c5d71a1889ee1edfb648903bcee561c5fbadd82d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 4 Oct 2018 10:50:37 +0100 Subject: ci: Use ccache to speed up repeated builds Signed-off-by: Simon McVittie (cherry picked from commit d0728fd06e5a2302e7596e3df56b68b0a0834fd7) --- .gitignore | 1 + .gitlab-ci.yml | 10 ++++++++++ tools/ci-install.sh | 1 + 3 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 6398e77c..04c276c1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.rej *.o *~ +/.ccache/ /build-aux/ compile config.cache diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c042aa2..96d632d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,16 @@ stages: before_script: - ./tools/ci-install.sh + - mkdir -p .ccache + - export CCACHE_BASEDIR="$(pwd)" + - export CCACHE_DIR="$CCACHE_BASEDIR/.ccache" + # Debian's ccache package creates symlinks here for all supported + # compilers + - export PATH="/usr/lib/ccache:$PATH" + +cache: + paths: + - .ccache/ variables: ci_in_docker: "yes" diff --git a/tools/ci-install.sh b/tools/ci-install.sh index 2e2946fc..30d4abe0 100755 --- a/tools/ci-install.sh +++ b/tools/ci-install.sh @@ -126,6 +126,7 @@ case "$ci_distro" in autoconf-archive \ automake \ autotools-dev \ + ccache \ cmake \ debhelper \ dh-autoreconf \ -- cgit v1.2.1