gitlab-ci: use ccache to speed up builds

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
Eric Engestrom
2019-02-12 16:59:27 +00:00
committed by Eric Engestrom
parent dbe3af67a4
commit 23b485c920
2 changed files with 20 additions and 5 deletions

View File

@@ -16,10 +16,13 @@
# The format of the tag is "%Y-%m-%d-${counter}" where ${counter} stays # The format of the tag is "%Y-%m-%d-${counter}" where ${counter} stays
# at "01" unless you have multiple updates on the same day :) # at "01" unless you have multiple updates on the same day :)
variables: variables:
UBUNTU_TAG: 2019-01-31-01 UBUNTU_TAG: 2019-02-12-01
UBUNTU_IMAGE: "$CI_REGISTRY_IMAGE/ubuntu:$UBUNTU_TAG" UBUNTU_IMAGE: "$CI_REGISTRY_IMAGE/ubuntu:$UBUNTU_TAG"
UBUNTU_IMAGE_MAIN: "registry.freedesktop.org/mesa/mesa/ubuntu:$UBUNTU_TAG" UBUNTU_IMAGE_MAIN: "registry.freedesktop.org/mesa/mesa/ubuntu:$UBUNTU_TAG"
cache:
paths:
- ccache
stages: stages:
- containers-build - containers-build
@@ -63,10 +66,21 @@ containers:ubuntu:
artifacts: artifacts:
when: on_failure when: on_failure
untracked: true untracked: true
# Use ccache transparently, and print stats before/after
before_script:
- export PATH="/usr/lib/ccache:$PATH"
- export CCACHE_BASEDIR="$PWD"
- export CCACHE_DIR="$PWD/ccache"
- export CCACHE_COMPILERCHECK=content
- ccache --zero-stats || true
- ccache --show-stats || true
after_script:
- export CCACHE_DIR="$PWD/ccache"
- ccache --show-stats
.meson-build: .meson-build:
extends: .build extends: .build
before_script: script:
# We need to control the version of llvm-config we're using, so we'll # We need to control the version of llvm-config we're using, so we'll
# generate a native file to do so. This requires meson >=0.49 # generate a native file to do so. This requires meson >=0.49
- if test -n "$LLVM_VERSION"; then - if test -n "$LLVM_VERSION"; then
@@ -88,7 +102,6 @@ containers:ubuntu:
-D vulkan-drivers=${VULKAN_DRIVERS:-[]} -D vulkan-drivers=${VULKAN_DRIVERS:-[]}
- cd _build - cd _build
- meson configure - meson configure
script:
- ninja -j4 - ninja -j4
- ninja test - ninja test
@@ -96,7 +109,7 @@ containers:ubuntu:
extends: .build extends: .build
variables: variables:
MAKEFLAGS: "-j4" MAKEFLAGS: "-j4"
before_script: script:
- if test -n "$LLVM_VERSION"; then - if test -n "$LLVM_VERSION"; then
export LLVM_CONFIG="llvm-config-${LLVM_VERSION}"; export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
fi fi
@@ -112,7 +125,6 @@ containers:ubuntu:
--with-gallium-drivers=$GALLIUM_DRIVERS --with-gallium-drivers=$GALLIUM_DRIVERS
--with-vulkan-drivers=$VULKAN_DRIVERS --with-vulkan-drivers=$VULKAN_DRIVERS
--disable-llvm-shared-libs --disable-llvm-shared-libs
script:
- make - make
- eval $MAKE_CHECK_COMMAND - eval $MAKE_CHECK_COMMAND

View File

@@ -158,5 +158,8 @@ RUN pip2 install 'scons>=2.4'
RUN pip2 install mako RUN pip2 install mako
RUN pip3 install mako RUN pip3 install mako
# Use ccache to speed up builds
RUN apt-get install -y ccache
# Cleanup workdir # Cleanup workdir
WORKDIR / WORKDIR /