diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-12-04 17:56:38 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-12-05 18:21:47 +0100 |
commit | 9ef43fe6000122490fa2f74e49575513e0059b31 (patch) | |
tree | f46fdf290344aad04c90352dd1d2220fea6e812c /.gitlab-ci.yml | |
parent | 02d1bdb3aadc5ac05bbd8b3a4beb9d0eb5562b5c (diff) |
gitlab-ci: Use ccache
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d297778de..6a6ff0611 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,11 @@ image: debian:unstable variables: DEBIAN_FRONTEND: noninteractive + CCACHE_DIR: $CI_PROJECT_DIR/.ccache + CCACHE_BASEDIR: $CI_PROJECT_DIR +cache: + paths: + - .ccache test as root: stage: test @@ -8,12 +13,12 @@ test as root: - adduser --home /home/travis travis --quiet --disabled-login --gecos "" --uid 1000 - rm -f /etc/dpkg/dpkg.cfg.d/excludes - apt-get update - - apt-get install -qq build-essential expect sudo + - apt-get install -qq build-essential expect sudo ccache - chmod -R o+rwX $PWD - ./prepare-release travis-ci - - sudo -u travis mkdir build - - sudo -u travis env -C build cmake -DCMAKE_BUILD_TYPE=Release -G Ninja .. - - sudo -u travis ninja -C build + - sudo -u travis mkdir -p build .ccache + - sudo -u travis env -C build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja .. + - sudo -u travis --preserve-env=CCACHE_DIR,CCACHE_BASEDIR ninja -C build - CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test - unbuffer ./test/integration/run-tests -q -j 4 @@ -23,12 +28,12 @@ test as user: - adduser --home /home/travis travis --quiet --disabled-login --gecos "" --uid 1000 - rm -f /etc/dpkg/dpkg.cfg.d/excludes - apt-get update - - apt-get install -qq build-essential expect sudo + - apt-get install -qq build-essential expect sudo ccache - chmod 755 /root - chmod -R o+rwX $PWD - ./prepare-release travis-ci - - sudo -u travis mkdir build - - sudo -u travis env -C build cmake -DCMAKE_BUILD_TYPE=Release -G Ninja .. - - sudo -u travis ninja -C build + - sudo -u travis mkdir -p build .ccache + - sudo -u travis env -C build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja .. + - sudo -u travis --preserve-env=CCACHE_DIR,CCACHE_BASEDIR ninja -C build - sudo -u travis CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test - sudo -u travis unbuffer ./test/integration/run-tests -q -j 4 |