mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 00:47: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:
parent
e4ffaedf1f
commit
0cfe37703c
2 changed files with 41 additions and 18 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -107,3 +107,6 @@ src/servers/Server_Common/Version\.cpp
|
|||
|
||||
# edit and continue files
|
||||
/enc_temp_folder
|
||||
|
||||
# travis-ci build mtime cache
|
||||
.mtime_cache
|
||||
|
|
48
.travis.yml
48
.travis.yml
|
@ -1,24 +1,44 @@
|
|||
---
|
||||
language: c++
|
||||
|
||||
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:
|
||||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
- sudo add-apt-repository universe
|
||||
- eval "${MATRIX_EVAL}"
|
||||
- gem install --no-ri --no-rdoc mtime_cache
|
||||
- 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 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
|
||||
|
|
Loading…
Add table
Reference in a new issue