mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
CI/Circle CI: Prepare master for circle ci (#24386)
* Circle CI (#22982) * Build/CI: Add Circle CI * Fix travis (cherry picked from commitcb6439bacd) * CI/CircleCI: Add parallel no-pch build (cherry picked from commit33c58b4aaf) * CI/CircleCI: Use ccache for nopch (cherry picked from commit6bcf5c64c4) * CI/CircleCI: Change base docker image to custom-built trinitycore one (cherry picked from commit37beeb1282) * CI/CircleCI: Switch to Ubuntu 18.10 (cherry picked from commit6dfb4fde07) * CI/CircleCI: Switch to Ubuntu 19.04 (cherry picked from commit9009c82a8d) * CI/Circle CI: Reduce ccache size from 5G to 1G This should speedup Circle CI cache saving and in turn no-pch build (cherry picked from commit1b543ac16d) * CI/Circle CI: Adjust config for master branch Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
98
.circleci/config.yml
Normal file
98
.circleci/config.yml
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
version: 2
|
||||||
|
jobs:
|
||||||
|
pch_and_sql:
|
||||||
|
docker:
|
||||||
|
- image: trinitycore/circle-ci:master-buildpacks-disco
|
||||||
|
- image: circleci/mysql:5.7
|
||||||
|
environment:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
||||||
|
MYSQL_ROOT_PASSWORD: ''
|
||||||
|
MYSQL_DATABASE: test_mysql
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Checkout
|
||||||
|
command: |
|
||||||
|
/scripts/checkout.sh
|
||||||
|
- run:
|
||||||
|
name: Setup
|
||||||
|
command: |
|
||||||
|
mkdir bin
|
||||||
|
cd bin
|
||||||
|
cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install
|
||||||
|
cd ..
|
||||||
|
- run:
|
||||||
|
name: SQL checks
|
||||||
|
command: |
|
||||||
|
chmod +x contrib/check_updates.sh
|
||||||
|
dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
|
||||||
|
mysql -h 127.0.0.1 -uroot < sql/create/create_mysql.sql
|
||||||
|
mysql -h 127.0.0.1 -uroot auth < sql/base/auth_database.sql
|
||||||
|
./contrib/check_updates.sh auth master auth 127.0.0.1
|
||||||
|
mysql -h 127.0.0.1 -uroot characters < sql/base/characters_database.sql
|
||||||
|
./contrib/check_updates.sh characters master characters 127.0.0.1
|
||||||
|
mysql -h 127.0.0.1 -uroot world < sql/base/dev/world_database.sql
|
||||||
|
mysql -h 127.0.0.1 -uroot hotfixes < sql/base/dev/hotfixes_database.sql
|
||||||
|
cat sql/updates/world/master/*.sql | mysql -h 127.0.0.1 -uroot world
|
||||||
|
cat sql/updates/hotfixes/master/*.sql | mysql -h 127.0.0.1 -uroot hotfixes
|
||||||
|
mysql -h 127.0.0.1 -uroot < sql/create/drop_mysql.sql
|
||||||
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: |
|
||||||
|
cd bin
|
||||||
|
make -j 4 -k && make install
|
||||||
|
cd check_install/bin
|
||||||
|
./bnetserver --version
|
||||||
|
./worldserver --version
|
||||||
|
nopch:
|
||||||
|
docker:
|
||||||
|
- image: trinitycore/circle-ci:master-buildpacks-disco
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
name: Requirements
|
||||||
|
command: |
|
||||||
|
sudo mkdir -p /root/.ccache
|
||||||
|
sudo chown -Rv circleci:circleci /root
|
||||||
|
- run:
|
||||||
|
name: Checkout
|
||||||
|
command: |
|
||||||
|
/scripts/checkout.sh
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- master-nopch-{{ .Branch }}-{{ .Revision }}
|
||||||
|
- master-nopch-{{ .Branch }}
|
||||||
|
- master-nopch
|
||||||
|
- run:
|
||||||
|
name: Setup
|
||||||
|
command: |
|
||||||
|
export CCACHE_MAXSIZE="1G"
|
||||||
|
export CC="ccache clang"
|
||||||
|
export CXX="ccache clang++"
|
||||||
|
export CCACHE_CPP2=yes
|
||||||
|
export USE_CCACHE=1
|
||||||
|
export PATH=/usr/lib/ccache:$PATH
|
||||||
|
ccache -s
|
||||||
|
git config user.email "circleci@build.bot" && git config user.name "Circle CI"
|
||||||
|
$CXX --version
|
||||||
|
mkdir bin
|
||||||
|
cd bin
|
||||||
|
cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=0 -DUSE_SCRIPTPCH=0 -DTOOLS=1 -DSCRIPTS=dynamic -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install
|
||||||
|
cd ..
|
||||||
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: |
|
||||||
|
cd bin
|
||||||
|
make -j 4 -k && make install
|
||||||
|
ccache -s
|
||||||
|
cd check_install/bin
|
||||||
|
./bnetserver --version
|
||||||
|
./worldserver --version
|
||||||
|
- save_cache:
|
||||||
|
key: master-nopch-{{ .Branch }}-{{ .Revision }}
|
||||||
|
paths:
|
||||||
|
- /home/circleci/.ccache
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build_all:
|
||||||
|
jobs:
|
||||||
|
- pch_and_sql
|
||||||
|
- nopch
|
||||||
@@ -47,9 +47,9 @@ script:
|
|||||||
- $CXX --version
|
- $CXX --version
|
||||||
- mysql -uroot < sql/create/create_mysql.sql
|
- mysql -uroot < sql/create/create_mysql.sql
|
||||||
- mysql -utrinity -ptrinity auth < sql/base/auth_database.sql
|
- mysql -utrinity -ptrinity auth < sql/base/auth_database.sql
|
||||||
- ./contrib/check_updates.sh auth master auth
|
- ./contrib/check_updates.sh auth master auth localhost
|
||||||
- mysql -utrinity -ptrinity characters < sql/base/characters_database.sql
|
- mysql -utrinity -ptrinity characters < sql/base/characters_database.sql
|
||||||
- ./contrib/check_updates.sh characters master characters
|
- ./contrib/check_updates.sh characters master characters localhost
|
||||||
- mysql -utrinity -ptrinity world < sql/base/dev/world_database.sql
|
- mysql -utrinity -ptrinity world < sql/base/dev/world_database.sql
|
||||||
- mysql -utrinity -ptrinity hotfixes < sql/base/dev/hotfixes_database.sql
|
- mysql -utrinity -ptrinity hotfixes < sql/base/dev/hotfixes_database.sql
|
||||||
- cat sql/updates/world/master/*.sql | mysql -utrinity -ptrinity world
|
- cat sql/updates/world/master/*.sql | mysql -utrinity -ptrinity world
|
||||||
|
|||||||
@@ -2,13 +2,14 @@
|
|||||||
name=$1
|
name=$1
|
||||||
branch=$2
|
branch=$2
|
||||||
database=$3
|
database=$3
|
||||||
|
host=$4
|
||||||
|
|
||||||
echo "Database Updater check script:"
|
echo "Database Updater check script:"
|
||||||
echo " Checking database '${name}' for missing filenames in tables..."
|
echo " Checking database '${name}' for missing filenames in tables..."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Select all entries which are in the updates table
|
# Select all entries which are in the updates table
|
||||||
entries=$(mysql -uroot ${database} -e "SELECT name FROM updates" | grep ".sql")
|
entries=$(mysql -uroot ${database} -h ${host} -e "SELECT name FROM updates" | grep ".sql")
|
||||||
|
|
||||||
cd sql/updates/${name}/${branch}
|
cd sql/updates/${name}/${branch}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user