forked from LandSandBoat/server
-
Notifications
You must be signed in to change notification settings - Fork 0
267 lines (250 loc) · 8.09 KB
/
Copy pathbuild.yml
File metadata and controls
267 lines (250 loc) · 8.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
name: build
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- base
- everything
jobs:
Linux_2004_Clang_9_64bit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
- name: Configure CMake
run: |
export CC=/usr/bin/clang-9
export CXX=/usr/bin/clang++-9
cmake .
- name: Build
run: |
make -j $(nproc)
Linux_2004_GCC9_64bit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
- name: Configure CMake
run: |
export CC=/usr/bin/gcc-9
export CXX=/usr/bin/g++-9
CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64 cmake .
- name: Build
run: |
make -j $(nproc)
Windows_2019_32bit:
runs-on: windows-2019
env:
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Configure CMake
shell: cmd
# windows-2019 CI machine has MySQL installed, need to specific our location by hand
run: |
cmake -A Win32 . -DMYSQL_INCLUDE_DIR='%CD%/ext/mysql/include/mysql' -DMYSQL_LIBRARY='%CD%/ext/mysql/lib/libmariadb.lib'
- name: Build
shell: cmd
run: |
cmake --build .
Windows_2019_64bit:
runs-on: windows-2019
env:
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Configure CMake
shell: cmd
# windows-2019 CI machine has MySQL installed, need to specific our location by hand
run: |
cmake -A x64 . -DMYSQL_INCLUDE_DIR='%CD%/ext/mysql/include/mysql' -DMYSQL_LIBRARY='%CD%/ext/mysql/lib64/libmariadb64.lib'
- name: Build
shell: cmd
run: |
cmake --build .
Style_Checks:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common clang-format luajit-5.1-dev luarocks
- name: Lua Checks
run: |
sh tools/ci/lua.sh
- name: Clang Format (C++ files)
if: 'false' # Don't run until fixed
run: |
clang-format --version
echo "Base Ref: ${{ github.event.pull_request.base.ref }}"
echo "Base SHA: ${{ github.event.pull_request.base.sha }}"
echo "Head Ref: ${{ github.event.pull_request.head.ref }}"
echo "Head SHA: ${{ github.event.pull_request.head.sha }}"
diff=`git diff -U0 --no-color ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- '*.cpp' '*.h' | clang-format-diff -p1`
if [ -z "$diff" ]
then
echo "Diff formatting looks good!"
else
echo "Problem with formatting!"
echo "To fix this locally, run: git diff -U0 --no-color ${{ github.event.pull_request.base.ref }}..HEAD -- '*.cpp' '*.h' | clang-format-diff -p1 -i"
echo ""
echo "$diff"
exit -1
fi
Full_Startup_Checks_2004:
runs-on: ubuntu-20.04
services:
mysql:
image: mariadb
env:
MYSQL_DATABASE: xidb
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common cmake mariadb-server-10.3 mariadb-client-10.3 libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks python3.7
- name: Configure CMake
run: |
export CC=/usr/bin/gcc-9
export CXX=/usr/bin/g++-9
cmake .
- name: Build Binaies
run: |
make -j $(nproc)
- name: Verify MySQL connection from container
run: |
mysql -h 127.0.0.1 -uroot -proot -e "SHOW DATABASES"
- name: Import SQL files
run: |
for f in sql/*.sql; do
echo -e "Importing $f into the database..."
mysql xidb -h 127.0.0.1 -uroot -proot < $f
done
mysql xidb -h 127.0.0.1 -uroot -proot -e "SHOW tables"
- name: Copy confs
run: |
cp conf/default/* conf/
- name: Run services (2 mins)
env:
MYSQL_HOST: mysql
run: |
ls -l
screen -d -m -S topaz_connect ./topaz_connect --log login-server.log
screen -d -m -S topaz_search ./topaz_search --log search-server.log
screen -d -m -S topaz_game ./topaz_game --log map-server.log
sleep 2m
killall screen
- name: Check for errors
run: |
cat login-server.log
cat map-server.log
cat search-server.log
if grep -qi "Error" login-server.log; then
exit -1
fi
if grep -qi "Error" map-server.log; then
exit -1
fi
if grep -qi "Error" search-server.log; then
exit -1
fi
MultiInstance_Startup_Checks_2004:
runs-on: ubuntu-20.04
services:
mysql:
image: mariadb
env:
MYSQL_DATABASE: xidb
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common cmake mariadb-server-10.3 mariadb-client-10.3 libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks python3.7
- name: Configure CMake
run: |
export CC=/usr/bin/gcc-9
export CXX=/usr/bin/g++-9
cmake .
- name: Build Binaies
run: |
make -j $(nproc)
- name: Verify MySQL connection from container
run: |
mysql -h 127.0.0.1 -uroot -proot -e "SHOW DATABASES"
- name: Import SQL files
run: |
for f in sql/*.sql; do
echo -e "Importing $f into the database..."
mysql xidb -h 127.0.0.1 -uroot -proot < $f
done
mysql xidb -h 127.0.0.1 -uroot -proot -e "SHOW tables"
- name: Assign odd zones a different port
run: |
mysql xidb -h 127.0.0.1 -uroot -proot -e "UPDATE xidb.zone_settings SET zoneport = 54231 WHERE zoneid % 2 = 0;"
- name: Copy confs
run: |
cp conf/default/* conf/
- name: Run services (2 mins)
env:
MYSQL_HOST: mysql
run: |
ls -l
screen -d -m -S topaz_connect ./topaz_connect --log login-server.log
screen -d -m -S topaz_search ./topaz_search --log search-server.log
screen -d -m -S topaz_game ./topaz_game --log map-server-0.log --port 54230
screen -d -m -S topaz_game ./topaz_game --log map-server-1.log --port 54231
sleep 2m
killall screen
- name: Check for errors
run: |
cat login-server.log
cat search-server.log
cat map-server-0.log
cat map-server-1.log
if grep -qi "Error" login-server.log; then
exit -1
fi
if grep -qi "Error" search-server.log; then
exit -1
fi
if grep -qi "Error" map-server-0.log; then
exit -1
fi
if grep -qi "Error" map-server-1.log; then
exit -1
fi