ci: Use ccache to speed up repeated builds
authorSimon McVittie <smcv@collabora.com>
Thu, 4 Oct 2018 09:50:37 +0000 (10:50 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 4 Oct 2018 15:58:13 +0000 (16:58 +0100)
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit d0728fd06e5a2302e7596e3df56b68b0a0834fd7)

.gitignore
.gitlab-ci.yml
tools/ci-install.sh

index 6398e77..04c276c 100644 (file)
@@ -3,6 +3,7 @@
 *.rej
 *.o
 *~
+/.ccache/
 /build-aux/
 compile
 config.cache
index 2c042aa..96d632d 100644 (file)
@@ -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"
index 2e2946f..30d4abe 100755 (executable)
@@ -126,6 +126,7 @@ case "$ci_distro" in
             autoconf-archive \
             automake \
             autotools-dev \
+            ccache \
             cmake \
             debhelper \
             dh-autoreconf \