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 <ajax@redhat.com> # v1
This commit is contained in:
Michel Dänzer 2019-02-14 17:39:24 +01:00 committed by Michel Dänzer
parent 537f06e21e
commit b577df7745
1 changed files with 11 additions and 0 deletions

View File

@ -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