From 4b5722dff41da5fd23ebddccd3854220f623ac22 Mon Sep 17 00:00:00 2001 From: Richard Weickelt Date: Fri, 22 Nov 2019 07:12:12 +0100 Subject: Enable ccache on Linux/Docker This speeds up CI builds a lot. Change-Id: I53962e1683b4dd923c3a7d254db24164a4e623a6 Reviewed-by: Ivan Komissarov Reviewed-by: Christian Kandeler --- .travis.yml | 20 ++++++++++++++------ docker-compose.yml | 5 ++++- docker/bionic/Dockerfile | 1 + scripts/build-qbs-with-qbs.sh | 3 ++- scripts/build-qbs-with-qmake.sh | 3 ++- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce56b8d46..cbe43f177 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,23 +24,31 @@ jobs: stage: Build Qbs and and run autotests name: With Qbs on Ubuntu bionic (linux_gcc64) env: - SERVICE=bionic + BUILD_OPTIONS=modules.cpp.compilerWrapper:ccache services: - docker - before_install: - - docker-compose pull ${SERVICE} + before_script: + - docker-compose pull bionic + - ccache -M 5G + - ccache -s + after_script: + - ccache -s script: - - docker-compose run --rm ${SERVICE} scripts/build-qbs-with-qbs.sh + - docker-compose run bionic scripts/build-qbs-with-qbs.sh - <<: *build-on-bionic name: With QMake on Ubuntu bionic (linux_gcc64) + env: + BUILD_OPTIONS="CONFIG+=ccache" script: - - docker-compose run --rm ${SERVICE} scripts/build-qbs-with-qmake.sh + - docker-compose run bionic scripts/build-qbs-with-qmake.sh - <<: *build-on-bionic name: With Qbs on Ubuntu bionic (mingw32_w64) + env: + BUILD_OPTIONS="profile:qt-mingw32_w64 modules.cpp.compilerWrapper:ccache modules.cpp.treatWarningsAsErrors:true config:release" script: - - docker-compose run --rm ${SERVICE} qbs build profile:qt-mingw32_w64 modules.cpp.treatWarningsAsErrors:true + - docker-compose run bionic qbs build ${BUILD_OPTIONS} - &build-on-macos stage: Build Qbs and and run autotests diff --git a/docker-compose.yml b/docker-compose.yml index 6770bebfd..e0726da77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,11 @@ version: "3.7" x-default-service: &linux working_dir: /qbs + environment: + - BUILD_OPTIONS volumes: - .:/qbs + - ~/.ccache:/home/devel/.ccache network_mode: bridge cap_add: - SYS_PTRACE @@ -12,7 +15,7 @@ services: bionic: << : *linux hostname: bionic - image: ${DOCKER_USER:-qbsbuild}/qbsdev:bionic-5.12.6_1.14.1-0 + image: ${DOCKER_USER:-qbsbuild}/qbsdev:bionic-5.12.6_1.14.1-1 build: dockerfile: docker/bionic/Dockerfile context: . diff --git a/docker/bionic/Dockerfile b/docker/bionic/Dockerfile index ed0625fb1..3336c8599 100644 --- a/docker/bionic/Dockerfile +++ b/docker/bionic/Dockerfile @@ -121,6 +121,7 @@ RUN apt-get update -qq && \ apt-get install -qq -y --no-install-recommends \ build-essential \ ca-certificates \ + ccache \ curl \ git \ libclang-3.9 \ diff --git a/scripts/build-qbs-with-qbs.sh b/scripts/build-qbs-with-qbs.sh index 229f5d691..b4f0643c5 100755 --- a/scripts/build-qbs-with-qbs.sh +++ b/scripts/build-qbs-with-qbs.sh @@ -55,7 +55,8 @@ BUILD_OPTIONS="\ modules.qbsbuildconfig.enableUnitTests:true \ modules.cpp.treatWarningsAsErrors:true \ project.withExamples:true \ - ${BUILD_OPTIONS} + ${BUILD_OPTIONS} \ + config:release \ " # diff --git a/scripts/build-qbs-with-qmake.sh b/scripts/build-qbs-with-qmake.sh index f06501e30..1e97d7695 100755 --- a/scripts/build-qbs-with-qmake.sh +++ b/scripts/build-qbs-with-qmake.sh @@ -50,7 +50,8 @@ export QBS_AUTOTEST_SETTINGS_DIR="${QBS_AUTOTEST_SETTINGS_DIR:-/tmp/qbs-settings # qmake -r qbs.pro \ CONFIG+=qbs_enable_unit_tests \ - CONFIG+=qbs_enable_project_file_updates + CONFIG+=qbs_enable_project_file_updates \ + ${BUILD_OPTIONS} make -j $(nproc --all) make docs -- cgit v1.2.3