Files
azerothcore-wotlk/.travis.yml
Stoabrogga 24ccbd69e3 feat(Travis): speed up and stabilize build process (#1410)
- Use Travis build matrix to test build with clang 3.8 and clang 7
- Set the number of threads for the "make" command to 4 (Travis provides only 2 cores, see https://docs.travis-ci.com/user/reference/overview/, so 4 threads should be good to go)
- Use Travis caching (https://docs.travis-ci.com/user/caching/) and ccache to speed up the build process (with full cache now takes about 7-8 minutes); a separate cache is used for clang 3.8 and clang 7
- Added a 43 minute timeout for the "make" command in order to ensure that the cache is saved within Travis (Travis will kill the build process after 50 minutes without saving the cache, see https://docs.travis-ci.com/user/customizing-the-build/). If the "make" command is terminated by the timeout it suffices to restart the Travis build job in order to use the already written cache.
2019-02-11 09:03:32 +01:00

87 lines
3.3 KiB
YAML

sudo: required
dist: xenial # (16.04)
# bionic (18.04) is not yet available in travis
language: cpp
cache: ccache
addons:
apt:
update: true
services:
- mysql
git:
depth: 1
matrix:
include:
- os: linux
addons:
apt:
packages:
- clang-3.8
env:
- CCOMPILERC="clang-3.8"
- CCOMPILERCXX="clang++-3.8"
- os: linux
addons:
apt:
sources:
- llvm-toolchain-xenial-7
packages:
- clang-7
env:
- CCOMPILERC="clang-7"
- CCOMPILERCXX="clang++-7"
before_install:
- git config user.email "azerothcorebot@gmail.com" && git config user.name "AzerothCoreBot"
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cd bin/; fi
# import pending sql
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then bash acore-db-pendings; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cd ..; fi
# push changes to git if any
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git fetch --unshallow; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git checkout $TRAVIS_BRANCH; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [[ -n "$GITHUB_API_KEY" ]]; then git add -A . && git diff --cached --quiet || git commit -am "Import pending SQL update file" && git push https://$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG.git $TRAVIS_BRANCH; fi
# sync staging with master
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ] && [[ -n "$GITHUB_API_KEY" ]]; then git fetch origin staging:staging && git checkout staging && git merge --no-edit master && git push https://$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG.git staging; git checkout master; fi
install:
# install OS deps (apt-get)
- bash ./acore.sh "install-deps"
# create config file
- echo "CCOMPILERC=$CCOMPILERC" >> conf/config.sh
- echo "CCOMPILERCXX=$CCOMPILERCXX" >> conf/config.sh
- echo "MTHREADS=4" >> conf/config.sh
- echo "CWARNINGS=ON" >> conf/config.sh
- echo "CDEBUG=OFF" >> conf/config.sh
- echo "CTYPE=Release" >> conf/config.sh
- echo "CSCRIPTS=ON" >> conf/config.sh
- echo "CSERVERS=ON" >> conf/config.sh
- echo "CTOOLS=ON" >> conf/config.sh
- echo "CSCRIPTPCH=OFF" >> conf/config.sh
- echo "CCOREPCH=OFF" >> conf/config.sh
- echo "CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS=\"-Werror\" -DCMAKE_CXX_FLAGS=\"-Werror\"'" >> conf/config.sh
- echo "DB_CHARACTERS_CONF=\"MYSQL_USER='root'; MYSQL_PASS=''; MYSQL_HOST='127.0.0.1';\"" >> conf/config.sh
- echo "DB_AUTH_CONF=\"MYSQL_USER='root'; MYSQL_PASS=''; MYSQL_HOST='127.0.0.1';\"" >> conf/config.sh
- echo "DB_WORLD_CONF=\"MYSQL_USER='root'; MYSQL_PASS=''; MYSQL_HOST='127.0.0.1';\"" >> conf/config.sh
# create and import mysql
- mysql -e "SET GLOBAL sql_mode = '';" # this is necessary because of mysql 5.7
- bash ./acore.sh "db-assembler" "import-all"
script:
# compile
- export CCACHE_CPP2=true
- ccache -s
- timeout 2580 bash ./acore.sh "compiler" "all"
- ccache -s
- git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git /home/travis/build/azerothcore/azerothcore-wotlk/env/dist/data
- cp ./data/travis/worldserver.conf ./env/dist/etc/worldserver.conf
- ./env/dist/bin/worldserver --dry-run
- ./apps/ci-error-check.sh