Skip to content

Commit

Permalink
Updated Build System
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1arm committed Jul 3, 2022
1 parent 8c805cd commit ac55373
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 36 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/core_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,7 @@ on:

jobs:
build:
strategy:
fail-fast: false

matrix:
compiler: [gcc, clang]

include:
- os: ubuntu-20.04
name: Ubuntu 20.04 GCC
compiler: gcc

- os: ubuntu-20.04
name: Ubuntu 20.04 Clang
compiler: clang

runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
env:
compiler: ${{ matrix.compiler }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -36,10 +18,13 @@ jobs:
run: sudo apt-get update -y

- name: Install Required Packages
run: sudo apt-get install -y git make cmake gcc g++ clang libssl-dev libbz2-dev build-essential default-libmysqlclient-dev libace-6.4.5 libace-dev python
run: sudo apt-get install -y git make cmake clang libssl-dev libbz2-dev build-essential default-libmysqlclient-dev libace-dev

- name: Update Compilers
run: source ./apps/ci/ci-compiler-update.sh

- name: Check for Submodule Updates
run: source ./apps/ci/ci-submodule-update.sh

- name: Build Mangos Project
run: source ./apps/ci/ci-compile.sh
12 changes: 6 additions & 6 deletions .github/workflows/core_windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ jobs:
build:
strategy:
fail-fast: false

runs-on: windows-2019
name: Windows Server 2019

steps:
- uses: actions/checkout@v2

- name: Configure Windows
run: choco install --no-progress openssl

- name: Checkout Submodules
shell: bash
run: |
run: |
git submodule init && git submodule update
- name: Build Project
shell: bash
run: |
Expand Down
16 changes: 15 additions & 1 deletion apps/ci/ci-codestyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -e

echo "Starting Codestyling Script:"
echo "Checking for whitespaces:"
echo

declare -A singleLineRegexChecks=(
Expand All @@ -21,5 +20,20 @@ for check in ${!singleLineRegexChecks[@]}; do
fi
done

# declare -A multiLineRegexChecks=(
# ["\n\n\n"]="Multiple blank lines detected, keep only one. Check the files above"
# )

# for check in ${!multiLineRegexChecks[@]}; do
# echo " Checking RegEx: '${check}'"

# if grep -Pzo -r -I ${check} src; then
# echo
# echo
# echo "${multiLineRegexChecks[$check]}"
# exit 1
# fi
# done

echo
echo "Awesome! No issues..."
13 changes: 5 additions & 8 deletions apps/ci/ci-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
set -e

# Check for & make directories
test -d _build || mkdir _build
test -d _install || mkdir _install
time test -d _build || mkdir _build
time test -d _install || mkdir _install

# Move to build folder
cd _build
time cd _build

# Run CMake Configurations
cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DBUILD_TOOLS:BOOL=1 -DBUILD_MANGOSD:BOOL=1 -DBUILD_REALMD:BOOL=1 -DSOAP:BOOL=1 -DSCRIPT_LIB_ELUNA:BOOL=1 -DSCRIPT_LIB_SD3:BOOL=1 -DPLAYERBOTS:BOOL=1 -DUSE_STORMLIB:BOOL=1 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/

# Check OpenSSL
which openssl
time cmake .. -DCMAKE_INSTALL_PREFIX=../_install -DBUILD_TOOLS:BOOL=1 -DBUILD_MANGOSD:BOOL=1 -DBUILD_REALMD:BOOL=1 -DSOAP:BOOL=1 -DSCRIPT_LIB_ELUNA:BOOL=1 -DSCRIPT_LIB_SD3:BOOL=1 -DPLAYERBOTS:BOOL=1 -DUSE_STORMLIB:BOOL=1

# Compile the Project
make -j 6
time make -j 6
7 changes: 7 additions & 0 deletions apps/ci/ci-compiler-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

# Update to Clang Compilers
time sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
time sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
7 changes: 7 additions & 0 deletions apps/whitespace_remover/whitespace_remover.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Required files
find -name '*.cpp' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i
find -name '*.h' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i

# Optional files - uncomment lines below to add them.
#find -name '*.txt' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i
#find -name '*.cmake' -print0 | xargs -r0 sed -e 's/[[:blank:]]\+$//' -i

0 comments on commit ac55373

Please sign in to comment.