1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-01 16:37:45 +00:00

Update Travis config for hopefully builds

Remove unnecessary dependencies and add a cache for the build files.
Additionally limit Git clone depth and use build matrices properly.
The CMake package dependency was removed since Travis comes with 3.2
and the installer only brings in 3.5, while the current minimum is 2.6.

Add support for mtime_cache, a small Ruby gem for hashing file mtime
and automatically updating unchanged files so that CMake knows which
cached build files are still valid since Git doesn't track mtime.
This commit is contained in:
Ay'yaruq Dotharl 2017-11-26 02:05:20 +11:00
parent e4ffaedf1f
commit 0cfe37703c
No known key found for this signature in database
GPG key ID: 79D2BF33B8AD2918
2 changed files with 41 additions and 18 deletions

5
.gitignore vendored
View file

@ -106,4 +106,7 @@ src/libraries/external/boost_*
src/servers/Server_Common/Version\.cpp
# edit and continue files
/enc_temp_folder
/enc_temp_folder
# travis-ci build mtime cache
.mtime_cache

View file

@ -1,24 +1,44 @@
---
language: c++
sudo: enabled
before_install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo add-apt-repository universe
- sudo apt-get update
- sudo apt-get install -y software-properties-common
- sudo apt-get update
- sudo apt-get install gcc-7 g++-7 gcc-7-multilib g++-7-multilib cmake3 -y
- sudo apt-get install libboost-dev libboost-all-dev libmysqlclient-dev -y
- sudo apt-get install libmysqlcppconn-dev -y
compiler:
- g++
sudo: enabled
git:
depth: 5
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
env:
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
# Setup cache
cache:
directories:
- build
- .mtime_cache
# Setup build matrix and dependencies
before_install:
- eval "${MATRIX_EVAL}"
- gem install --no-ri --no-rdoc mtime_cache
- sudo apt-get update
- sudo apt-get install -y libboost-dev libboost-all-dev
- sudo apt-get install -y libmysqlclient-dev libmysqlcppconn-dev
# Build steps
script:
- g++ --version
- mkdir build
- $CXX --version
- mtime_cache src/**/*.{%{cpp}} -c .mtime_cache/cache.json
- mkdir -p build
- cd build
- cmake .. -DSAPPHIRE_BOOST_VER="1.54.0" -DCMAKE_CXX_COMPILER=g++-7 && make -j 3
- cmake .. -DSAPPHIRE_BOOST_VER="1.54.0" && make -j 3
- cd ..
- bash sql_import.sh