From b577df77451d34e28cfef3bda5031a43caeba90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 14 Feb 2019 17:39:24 +0100 Subject: [PATCH] gitlab-ci: Use ccache Meson picks it up automatically. Based on: * https://gitlab.freedesktop.org/mesa/mesa/merge_requests/240 * https://gould.cx/ted/blog/2017/06/10/ccache-for-Gitlab-CI/ * https://stackoverflow.com/questions/53659419/ccache-no-hits-in-gitlab-ci v2 based on the corresponding Mesa change: * Quote CCACHE_(BASE)DIR environment variables. * Clear ccache stats in before_script. * Move cache stanza to the build-and-test job, the cache isn't used in the docker-image job. Reviewed-by: Adam Jackson # v1 --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61291371f..984a93854 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,10 +59,19 @@ build-and-test: when: on_failure paths: - build/test/piglit-results/ + cache: + paths: + - ccache/ variables: LC_ALL: C.UTF-8 PIGLIT_DIR: /root/piglit XTEST_DIR: /root/xts + before_script: + - export CCACHE_BASEDIR="$PWD" + - export CCACHE_DIR="$PWD/ccache" + - export CCACHE_COMPILERCHECK=content + - ccache --zero-stats + - ccache --show-stats script: - meson -Dprefix=/usr build/ - | @@ -74,3 +83,5 @@ build-and-test: cat build/meson-logs/testlog.txt cat build/test/piglit-results/xvfb/long-summary || : exit $status + after_script: + - CCACHE_DIR="$PWD/ccache" ccache --show-stats