feat(CI): migrate from Travis to GitHub Actions (#2887)

Co-authored-by: Yehonal <yehonal.azeroth@gmail.com>
This commit is contained in:
Rochet2
2020-04-19 18:33:13 +03:00
committed by GitHub
parent 2514f8fc9a
commit 1397971943
13 changed files with 145 additions and 152 deletions
-21
View File
@@ -1,21 +0,0 @@
#!/bin/bash
set -e
if [ "$TRAVIS_BUILD_ID" = "1" ]
then
export CCOMPILERC="clang-6.0"
export CCOMPILERCXX="clang++-6.0"
echo "set root password"
export DB_RND_NAME=$(cat /dev/urandom | tr -dc 'a-z' | fold -w 5 | head -n 1)
sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('$DB_RND_NAME') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
sudo mysql_upgrade -u root -p$DB_RND_NAME
sudo service mysql restart
printf "[client]\npassword=%s" "$DB_RND_NAME" >~/.my.cnf
chmod 400 ~/.my.cnf
elif [ "$TRAVIS_BUILD_ID" = "2" ]
then
export CCOMPILERC="clang-7"
export CCOMPILERCXX="clang++-7"
fi
+2 -1
View File
@@ -4,6 +4,7 @@ set -e
echo "compile core"
export CCACHE_CPP2=true
export CCACHE_MAXSIZE='500MB'
ccache -s
timeout 2700 bash ./acore.sh "compiler" "all"
./acore.sh "compiler" "all"
ccache -s
+1 -2
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env bash
DB_ERRORS_FILE="/home/travis/build/azerothcore/azerothcore-wotlk/env/dist/bin/DBErrors.log";
#DB_ERRORS_FILE="./env/dist/bin/DBErrors.log";
DB_ERRORS_FILE="./env/dist/bin/DBErrors.log";
if [[ ! -f ${DB_ERRORS_FILE} ]]; then
echo "File ${DB_ERRORS_FILE} not found!";
+8 -9
View File
@@ -2,14 +2,13 @@
set -e
if [ "$TRAVIS_BUILD_ID" = "1" ]
then
echo "import DB"
bash ./acore.sh "db-assembler" "import-all"
sudo systemctl start mysql
./acore.sh "db-assembler" "import-all"
if [ -s modules/mod-premium/sql/example_item_9017.sql ]
then
# if the premium module is available insert the example item or else the worldserver dry run will fail
mysql -u root world_$DB_RND_NAME <modules/mod-premium/sql/example_item_9017.sql
fi
if [ -s modules/mod-premium/sql/example_item_9017.sql ]
then
echo "Import custom module item..."
# if the premium module is available insert the example item or else the worldserver dry run will fail
mysql -uroot -proot acore_world < modules/mod-premium/sql/example_item_9017.sql
echo "Done!"
fi
+28 -23
View File
@@ -2,37 +2,42 @@
set -e
echo "install OS deps (apt-get)"
bash ./acore.sh "install-deps"
if [ "$TRAVIS_BUILD_ID" = "1" ]
then
echo "install clang-6.0"
sudo apt-get install clang-6.0
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=$(expr $(grep -c ^processor /proc/cpuinfo) + 2)
CWARNINGS=ON
CDEBUG=OFF
CTYPE=Release
CSCRIPTS=$1
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
DB_CHARACTERS_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
DB_AUTH_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
DB_WORLD_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
CONFIG_SH
time sudo apt-get update -y
# time sudo apt-get upgrade -y
time sudo apt-get install -y git lsb-release sudo ccache
time ./acore.sh install-deps
case $COMPILER in
"clang6" )
time sudo apt-get install -y clang-6.0
echo "CCOMPILERC=\"clang-6.0\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-6.0\"" >> ./conf/config.sh
;;
"clang7" )
time sudo apt-get install -y clang-7
echo "CCOMPILERC=\"clang-7\"" >> ./conf/config.sh
echo "CCOMPILERCXX=\"clang++-7\"" >> ./conf/config.sh
;;
* )
echo "Unknown compiler $COMPILER"
exit 1
;;
esac
+7 -8
View File
@@ -2,11 +2,10 @@
set -e
if [ "$TRAVIS_BUILD_ID" = "1" ]
then
echo "start worldserver dry-run"
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
sed -e "s/;;acore_auth/;$DB_RND_NAME;auth_$DB_RND_NAME/" -e "s/;;acore_world/;$DB_RND_NAME;world_$DB_RND_NAME/" -e "s/;;acore_characters/;$DB_RND_NAME;characters_$DB_RND_NAME/" ./data/travis/worldserver.conf >./env/dist/etc/worldserver.conf
./env/dist/bin/worldserver --dry-run
./apps/ci/ci-error-check.sh
fi
echo "[worldserver]" >> ./env/dist/etc/worldserver.conf
echo "DataDir = \"../data/\"" >> ./env/dist/etc/worldserver.conf
echo "LoginDatabaseInfo = \"localhost;3306;root;root;acore_auth\"" >> ./env/dist/etc/worldserver.conf
echo "WorldDatabaseInfo = \"localhost;3306;root;root;acore_world\"" >> ./env/dist/etc/worldserver.conf
echo "CharacterDatabaseInfo = \"localhost;3306;root;root;acore_characters\"" >> ./env/dist/etc/worldserver.conf
git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git ./env/dist/data
(cd ./env/dist/bin/ && timeout 5m ./worldserver --dry-run)