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

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