feat(CI): improve Travis configuration (#1486)

- use random DB names in order to detect statements which address a specific DB
- split compilation and DB check (DB check and dry run only have to run once)
- use separate shell scripts for easier module Travis integration
This commit is contained in:
Stoabrogga 2019-02-19 16:21:52 +01:00 committed by GitHub
parent 3a39aaeed5
commit e1c3433afc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 88 additions and 53 deletions

42
apps/ci/ci-install.sh Executable file
View file

@ -0,0 +1,42 @@
#!/bin/bash
echo "install OS deps (apt-get)"
bash ./acore.sh "install-deps"
if [ "$TRAVIS_BUILD_ID" = "1" ]
then
echo "install clang-3.8"
sudo apt-get install clang-3.8
elif [ "$TRAVIS_BUILD_ID" = "2" ]
then
echo "install clang-7"
sudo apt-get install clang-7
fi
echo "create config.sh"
cat >>conf/config.sh <<CONFIG_SH
CCOMPILERC=$CCOMPILERC
CCOMPILERCXX=$CCOMPILERCXX
MTHREADS=4
CWARNINGS=ON
CDEBUG=OFF
CTYPE=Release
CSCRIPTS=ON
CSERVERS=ON
CTOOLS=ON
CSCRIPTPCH=OFF
CCOREPCH=OFF
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
DB_CHARACTERS_CONF="MYSQL_USER='root'; MYSQL_PASS='$DB_RND_NAME'; MYSQL_HOST='localhost';"
DB_AUTH_CONF="MYSQL_USER='root'; MYSQL_PASS='$DB_RND_NAME'; MYSQL_HOST='localhost';"
DB_WORLD_CONF="MYSQL_USER='root'; MYSQL_PASS='$DB_RND_NAME'; MYSQL_HOST='localhost';"
DB_AUTH_NAME=auth_$DB_RND_NAME
DB_CHARACTERS_NAME=characters_$DB_RND_NAME
DB_WORLD_NAME=world_$DB_RND_NAME
CONFIG_SH
if [ "$TRAVIS_BUILD_ID" = "1" ]
then
echo "import DB"
bash ./acore.sh "db-assembler" "import-all"
fi