1
0
Fork 0

Travis: Fix ccache on debug builds (#4741)

This commit is contained in:
peterbell10 2020-05-16 12:57:14 +01:00 committed by GitHub
parent 104961b889
commit 21ef9e3819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions

View File

@ -13,42 +13,42 @@ addons:
confinement: classic confinement: classic
channel: latest channel: latest
matrix: jobs:
include: include:
# AppleClang Release
# OSX workers are slower to start up. Having these first in the build matrix makes travis faster overall. # OSX workers are slower to start up. Having these first in the build matrix makes travis faster overall.
- os: osx - name: "AppleClang - Release"
os: osx
osx_image: xcode11.3 osx_image: xcode11.3
before_install: before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache - HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
env: &Release env: &Release
- TRAVIS_CUBERITE_BUILD_TYPE=RELEASE - TRAVIS_CUBERITE_BUILD_TYPE=RELEASE
# AppleClang Debug - name: "AppleClang - Debug"
- os: osx os: osx
osx_image: xcode11.3 osx_image: xcode11.3
before_install: before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache - HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache
env: &Debug env: &Debug
- TRAVIS_CUBERITE_BUILD_TYPE=DEBUG - TRAVIS_CUBERITE_BUILD_TYPE=DEBUG
# Clang 7.0 - Release - name: "Clang 7.0 - Release"
- compiler: clang compiler: clang
before_install: &use-cmake before_install: &use-cmake
- export PATH=/snap/bin/:${PATH} - export PATH=/snap/bin/:${PATH}
env: *Release env: *Release
# Clang 7.0 - Debug - name: "Clang 7.0 - Debug"
- compiler: clang compiler: clang
before_install: *use-cmake before_install: *use-cmake
env: *Debug env: *Debug
# GCC 7.4 - Release, CMake 3.12 - name: "GCC 7.4 - Release, CMake 3.12"
- compiler: gcc compiler: gcc
env: *Release env: *Release
# GCC 7.4 - Debug - name: "GCC 7.4 - Debug"
- compiler: gcc compiler: gcc
before_install: *use-cmake before_install: *use-cmake
env: *Debug env: *Debug

View File

@ -11,16 +11,24 @@ if [ `which ccache` ]; then
export CCACHE_CPP2=true export CCACHE_CPP2=true
CACHE_ARGS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" CACHE_ARGS="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
echo "Using ccache installed at $(which ccache)" echo "Using ccache installed at $(which ccache)"
ccache --max-size=3G
ccache -z # Zero statistics
fi fi
cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1 ${CACHE_ARGS}; cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1 ${CACHE_ARGS};
echo "Building..." echo "Building..."
cmake --build . -- -j 2; cmake --build . -j 2
ctest -j 2 -V;
if [ `which ccache` ]; then
echo "Built with ccache, outputting cache stats..."
ccache -s
fi
echo "Testing..." echo "Testing..."
ctest -j 2 -V;
cd Server/; cd Server/;
touch apiCheckFailed.flag touch apiCheckFailed.flag
if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then if [ "$TRAVIS_CUBERITE_BUILD_TYPE" != "COVERAGE" ]; then