mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-18 16:37:46 +00:00

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.
44 lines
855 B
YAML
44 lines
855 B
YAML
---
|
|
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:
|
|
- 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:
|
|
- $CXX --version
|
|
- mtime_cache src/**/*.{%{cpp}} -c .mtime_cache/cache.json
|
|
- mkdir -p build
|
|
- cd build
|
|
- cmake .. -DSAPPHIRE_BOOST_VER="1.54.0" && make -j 3
|
|
- cd ..
|
|
- bash sql_import.sh
|