GitHub Actions Refactor (#143)

* Split Linux and Windows into their own jobs

* Implement Codestyling Check Script
* It checks for whitespaces (tabs).

* Fix some alignments.
This commit is contained in:
Meltie2013 2021-03-05 16:50:24 -06:00 committed by GitHub
parent b4e2348ef2
commit c0411110cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 28 deletions

View File

@ -1,4 +1,4 @@
name: core-build
name: Linux Build
on:
push:
branches: [ master ]
@ -43,30 +43,3 @@ jobs:
- name: Build Mangos Project
run: source ./apps/ci/ci-compile.sh
windows-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: |
git submodule init && git submodule update
- name: Build
shell: bash
run: |
mkdir -p build && cd build
cmake .. -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
cmake --build . --config Release --parallel 4

17
.github/workflows/core_codestyle.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Codestyle Checks
on:
push:
pull_request:
jobs:
check-codestyle:
strategy:
fail-fast: false
runs-on: ubuntu-20.04
name: Check Codestyling
steps:
- uses: actions/checkout@v2
- name: Check Codestyling
run: source ./apps/ci/ci-codestyle.sh

View File

@ -0,0 +1,32 @@
name: Windows Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
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: |
git submodule init && git submodule update
- name: Build Project
shell: bash
run: |
mkdir -p build && cd build
cmake .. -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
cmake --build . --config Release --parallel 4

25
apps/ci/ci-codestyle.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/bash
set -e
echo "Starting Codestyling Script:"
echo "Checking for whitespaces:"
echo
declare -A singleLineRegexChecks=(
["[[:blank:]]$"]="Remove whitespace at the end of the lines above"
["\t"]="Replace tabs with 4 spaces in the lines above"
)
for check in ${!singleLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -P -r -I -n ${check} src; then
echo
echo "${singleLineRegexChecks[$check]}"
exit 1
fi
done
echo
echo "Awesome! No issues..."