Skip to content

Commit 4a5eccf

Browse files
committed
Final CI touchups
1 parent 272d401 commit 4a5eccf

File tree

604 files changed

+26812
-12082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

604 files changed

+26812
-12082
lines changed

.clang-format

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
---
2-
BasedOnStyle: WebKit
2+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
# We base things of WebKit + Allman braces
4+
# BasedOnStyle: WebKit
5+
AccessModifierOffset: -4
6+
AllowShortFunctionsOnASingleLine: None
37
BreakBeforeBraces: Allman
4-
Cpp11BracedListStyle: 'true'
8+
BreakConstructorInitializers: BeforeComma
9+
# This is not the ACTUAL column limit, this is just to make
10+
# clang-format chill out! Use your best judgement!
11+
ColumnLimit: 160
12+
CompactNamespaces: 'false'
13+
ConstructorInitializerIndentWidth: 0
14+
Cpp11BracedListStyle: 'false'
15+
IndentCaseLabels: 'true'
16+
IndentWidth: 4
17+
KeepEmptyLinesAtTheStartOfBlocks: 'false'
518
Language: Cpp
619
PointerAlignment: Left
720
SortIncludes: 'true'
821
SortUsingDeclarations: 'true'
22+
SpaceBeforeParens: ControlStatements
923
Standard: Cpp11
1024
UseTab: Never
1125

.clang-tidy

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
3+
Checks: >
4+
-*,
5+
bugprone-*,
6+
-bugprone-reserved-identifier,
7+
cert-flp30-c,
8+
cert-mem57-cpp,
9+
cert-oop57-cpp,
10+
cert-oop58-cpp,
11+
clang-analyzer-*,
12+
readability-*,
13+
readability-braces-around-statements,
14+
-readability-magic-numbers,
15+
-readability-convert-member-functions-to-static,
16+
-readability-implicit-bool-conversion,
17+
modernize-*,
18+
-modernize-use-trailing-return-type,
19+
performance-*,
20+
cppcoreguidelines-pro-type-cstyle-cast,
21+
cppcoreguidelines-pro-type-static-cast-downcast,
22+
WarningsAsErrors: ''
23+
HeaderFilterRegex: '/src/*'
24+
AnalyzeTemporaryDtors: false
25+
...

.github/workflows/build.yml

+50-42
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- 'feature/**'
1414

1515
jobs:
16-
Linux_Build_32bit:
16+
Linux_Build_Clang_32bit:
1717
runs-on: ubuntu-18.04
1818
steps:
1919
- uses: actions/checkout@v1
@@ -22,15 +22,19 @@ jobs:
2222
- name: Install Dependencies
2323
run: |
2424
sudo apt-get update
25-
sudo apt-get install -y software-properties-common g++-8 luajit-5.1-dev libzmq3-dev luarocks python3.7
26-
- name: Build C++
25+
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
26+
- name: Configure CMake
27+
run: |
28+
export CC=/usr/bin/clang
29+
export CXX=/usr/bin/clang++
30+
export CFLAGS=-m32
31+
export CXXFLAGS=-m32
32+
cmake .
33+
- name: Build
2734
run: |
28-
g++ --version
29-
sh autogen.sh "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
30-
./configure
3135
make -j $(nproc)
3236
33-
Linux_Build_32bit_CMake:
37+
Linux_Build_GCC_32bit:
3438
runs-on: ubuntu-18.04
3539
steps:
3640
- uses: actions/checkout@v1
@@ -39,14 +43,19 @@ jobs:
3943
- name: Install Dependencies
4044
run: |
4145
sudo apt-get update
42-
sudo apt-get install -y software-properties-common g++-8 luajit-5.1-dev libzmq3-dev luarocks python3.7 cmake
43-
- name: Build C++
46+
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
47+
- name: Configure CMake
4448
run: |
45-
g++ --version
49+
export CC=/usr/bin/gcc
50+
export CXX=/usr/bin/g++
51+
export CFLAGS=-m32
52+
export CXXFLAGS=-m32
4653
cmake .
54+
- name: Build
55+
run: |
4756
make -j $(nproc)
4857
49-
Linux_Build_64bit:
58+
Linux_Build_GCC_64bit:
5059
runs-on: ubuntu-18.04
5160
steps:
5261
- uses: actions/checkout@v1
@@ -55,53 +64,51 @@ jobs:
5564
- name: Install Dependencies
5665
run: |
5766
sudo apt-get update
58-
sudo apt-get install -y software-properties-common g++-8 luajit-5.1-dev libzmq3-dev luarocks python3.7
59-
- name: Build C++
67+
sudo apt-get install -y software-properties-common cmake libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev
68+
- name: Configure CMake
69+
run: |
70+
export CC=/usr/bin/gcc
71+
export CXX=/usr/bin/g++
72+
CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64 cmake .
73+
- name: Build
6074
run: |
61-
g++ --version
62-
sh autogen.sh
63-
./configure "CFLAGS=-m64" "CXXFLAGS=-m64" "LDFLAGS=-m64"
6475
make -j $(nproc)
6576
66-
Windows_Build_32bit:
77+
Windows_Build_2019_32bit:
6778
runs-on: windows-2019
6879
env:
6980
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
7081
steps:
7182
- uses: actions/checkout@v1
7283
with:
7384
fetch-depth: 0
74-
- name: Build Solution
85+
- name: Configure CMake
7586
shell: cmd
87+
# windows-2019 CI machine has MySQL installed, need to specific our location by hand
7688
run: |
77-
"%MSBUILD_PATH%\MSBuild.exe" win32/topaz.sln /property:Platform=Win32
78-
79-
Windows_Build_32bit_CMake:
80-
runs-on: windows-2019
81-
env:
82-
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
83-
steps:
84-
- uses: actions/checkout@v1
85-
with:
86-
fetch-depth: 0
87-
- name: Build Solution
89+
cmake -A Win32 . -DMYSQL_INCLUDE_DIR='%CD%/ext/include/mysql' -DMYSQL_LIBRARY='%CD%/ext/lib/libmariadb.lib'
90+
- name: Build
8891
shell: cmd
8992
run: |
90-
cmake . -G "Visual Studio 16 2019"
91-
"%MSBUILD_PATH%\MSBuild.exe" topaz.sln
93+
cmake --build .
9294
93-
Windows_Build_64bit:
95+
Windows_Build_2019_64bit:
9496
runs-on: windows-2019
9597
env:
9698
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\
9799
steps:
98100
- uses: actions/checkout@v1
99101
with:
100102
fetch-depth: 0
101-
- name: Build Solution
103+
- name: Configure CMake
102104
shell: cmd
105+
# windows-2019 CI machine has MySQL installed, need to specific our location by hand
103106
run: |
104-
"%MSBUILD_PATH%\MSBuild.exe" win32/topaz.sln /property:Platform=x64
107+
cmake -A x64 . -DMYSQL_INCLUDE_DIR='%CD%/ext/include/mysql' -DMYSQL_LIBRARY='%CD%/ext/lib64/libmariadb64.lib'
108+
- name: Build
109+
shell: cmd
110+
run: |
111+
cmake --build .
105112
106113
Style_Checks:
107114
runs-on: ubuntu-20.04
@@ -159,12 +166,12 @@ jobs:
159166
- name: Install Dependencies
160167
run: |
161168
sudo apt-get update
162-
sudo apt-get install -y software-properties-common mariadb-server-10.1 libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev autoconf pkg-config zlib1g-dev libssl-dev
169+
sudo apt-get install -y software-properties-common cmake mariadb-server-10.1 libmariadb-dev-compat libluajit-5.1-dev libzmq3-dev zlib1g-dev libssl-dev luarocks python3.7
170+
- name: Configure CMake
171+
run: |
172+
cmake .
163173
- name: Build Binaies
164174
run: |
165-
g++ --version
166-
sh autogen.sh
167-
./configure "CFLAGS=-m64" "CXXFLAGS=-m64" "LDFLAGS=-m64"
168175
make -j $(nproc)
169176
- name: Verify MySQL connection from container
170177
run: |
@@ -181,8 +188,9 @@ jobs:
181188
cp conf/default/* conf/
182189
- name: Run services (2 mins)
183190
env:
184-
MYSQL_HOST: mydb
191+
MYSQL_HOST: mysql
185192
run: |
193+
ls -l
186194
screen -d -m -S topaz_connect ./topaz_connect --log login-server.log
187195
screen -d -m -S topaz_game ./topaz_game --log map-server.log
188196
screen -d -m -S topaz_search ./topaz_search --log search-server.log
@@ -194,14 +202,14 @@ jobs:
194202
cat map-server.log
195203
cat search-server.log
196204
197-
if grep -q error login-server.log; then
205+
if grep -qi "Error" login-server.log; then
198206
exit -1
199207
fi
200208
201-
if grep -q error map-server.log; then
209+
if grep -qi "Error" map-server.log; then
202210
exit -1
203211
fi
204212
205-
if grep -q error search-server.log; then
213+
if grep -qi "Error" search-server.log; then
206214
exit -1
207215
fi

.gitignore

+7-3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ ipch/
6363
# ReSharper is a .NET coding add-in
6464
_ReSharper*
6565

66+
# Jetbrains directories
67+
.idea
68+
cmake-*
69+
6670
# NCrunch
6771
*.ncrunch*
6872
.*crunch*.local.xml
@@ -129,6 +133,9 @@ UpgradeLog*.XML
129133
/topaz_connect
130134
/topaz_game
131135
/topaz_search
136+
/topaz_connect_64
137+
/topaz_game_64
138+
/topaz_search_64
132139

133140
# Generated files, mostly autotools-related
134141
.deps
@@ -190,6 +197,3 @@ cmake_install.cmake
190197
/conf/search_server.conf
191198
/conf/server_message.conf
192199
/conf/server_message_fr.conf
193-
194-
# Jetbrains files
195-
.idea/

CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,31 @@ set_property(GLOBAL PROPERTY CXX_STANDARD 17)
55
set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED ON)
66
set_property(GLOBAL PROPERTY CXX_EXTENSIONS ON)
77
set_property(GLOBAL PROPERTY LINKER_LANGUAGE CXX)
8+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
89

910
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1011
include(Platform)
1112
include(StandardProjectSettings)
1213
include(CompilerWarnings)
1314
include(Sanitizers)
15+
include(ClangTidy)
1416

1517
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
1618
message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER}")
1719
message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
1820
message(STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
1921
message(STATUS "CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
22+
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
2023
message(STATUS "CMAKE_GENERATOR_PLATFORM: ${CMAKE_GENERATOR_PLATFORM}")
2124

2225
# set(CMAKE_VERBOSE_MAKEFILE ON)
2326
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
2427

28+
set(LOCAL_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/ext/include)
29+
set(LOCAL_LIB_PATH ${PROJECT_SOURCE_DIR}/ext/${libpath})
30+
message(STATUS "LOCAL_INCLUDE_PATH: ${LOCAL_INCLUDE_PATH}")
31+
message(STATUS "LOCAL_LIB_PATH: ${LOCAL_LIB_PATH}")
32+
2533
# Find Threads (pthread)
2634
set(THREADS_PREFER_PTHREAD_FLAG ON)
2735
find_package(Threads REQUIRED)

CMakeSettings.json

+32-34
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,52 @@
1-
{
2-
"environments": [
3-
{
4-
"BuildDir": "${workspaceRoot}\\build\\${name}",
5-
"InstallDir": "${workspaceRoot}\\build\\${name}\\bin"
6-
}
7-
],
1+
{
82
"configurations": [
93
{
104
"name": "x86-Debug",
11-
"generator": "Visual Studio 16 2019",
5+
"generator": "Ninja",
126
"configurationType": "Debug",
13-
"inheritEnvironments": [ "msvc_x86" ],
14-
"buildRoot": "${env.BuildDir}",
15-
"installRoot": "${env.InstallDir}",
7+
"buildRoot": "${projectDir}\\out\\build\\${name}",
8+
"installRoot": "${projectDir}\\out\\install\\${name}",
169
"cmakeCommandArgs": "",
17-
"buildCommandArgs": "-v:detailed",
18-
"ctestCommandArgs": ""
10+
"buildCommandArgs": "",
11+
"ctestCommandArgs": "",
12+
"inheritEnvironments": [ "msvc_x86" ],
13+
"variables": []
1914
},
2015
{
2116
"name": "x86-Release",
22-
"generator": "Visual Studio 16 2019",
23-
"configurationType": "Release",
24-
"inheritEnvironments": [ "msvc_x86" ],
25-
"buildRoot": "${env.BuildDir}",
26-
"installRoot": "${env.InstallDir}",
17+
"generator": "Ninja",
18+
"configurationType": "RelWithDebInfo",
19+
"buildRoot": "${projectDir}\\out\\build\\${name}",
20+
"installRoot": "${projectDir}\\out\\install\\${name}",
2721
"cmakeCommandArgs": "",
28-
"buildCommandArgs": "-v:detailed",
29-
"ctestCommandArgs": ""
22+
"buildCommandArgs": "",
23+
"ctestCommandArgs": "",
24+
"inheritEnvironments": [ "msvc_x86" ],
25+
"variables": []
3026
},
3127
{
3228
"name": "x64-Debug",
33-
"generator": "Visual Studio 16 2019 Win64",
29+
"generator": "Ninja",
3430
"configurationType": "Debug",
35-
"inheritEnvironments": [ "msvc_x64" ],
36-
"buildRoot": "${env.BuildDir}",
37-
"installRoot": "${env.InstallDir}",
31+
"buildRoot": "${projectDir}\\out\\build\\${name}",
32+
"installRoot": "${projectDir}\\out\\install\\${name}",
3833
"cmakeCommandArgs": "",
39-
"buildCommandArgs": "-v:detailed",
40-
"ctestCommandArgs": ""
34+
"buildCommandArgs": "",
35+
"ctestCommandArgs": "",
36+
"inheritEnvironments": [ "msvc_x64_x64" ],
37+
"variables": []
4138
},
4239
{
4340
"name": "x64-Release",
44-
"generator": "Visual Studio 16 2019 Win64",
45-
"configurationType": "Release",
46-
"inheritEnvironments": [ "msvc_x64" ],
47-
"buildRoot": "${env.BuildDir}",
48-
"installRoot": "${env.InstallDir}",
41+
"generator": "Ninja",
42+
"configurationType": "RelWithDebInfo",
43+
"buildRoot": "${projectDir}\\out\\build\\${name}",
44+
"installRoot": "${projectDir}\\out\\install\\${name}",
4945
"cmakeCommandArgs": "",
50-
"buildCommandArgs": "-v:detailed",
51-
"ctestCommandArgs": ""
46+
"buildCommandArgs": "",
47+
"ctestCommandArgs": "",
48+
"inheritEnvironments": [ "msvc_x64_x64" ],
49+
"variables": []
5250
}
5351
]
54-
}
52+
}

0 commit comments

Comments
 (0)