Merge branch 'azerothcore:master' into Playerbot_merge29102025

This commit is contained in:
kadeshar
2025-10-29 06:37:33 +01:00
committed by GitHub
98 changed files with 1384 additions and 570 deletions

View File

@@ -39,16 +39,17 @@ inputs:
runs:
using: composite
steps:
- name: echo cache key
shell: bash
run: echo "Cache key -> ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}:${{ github.ref_name }}"
- name: Cache
uses: actions/cache@v4
if: inputs.pch != 'true'
with:
path: ${{ github.workspace }}/var/ccache
# format
# ccache:OS:CC_CXX:MODULES:GITHUB_REF:GITHUB_SHA
key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref }}:${{ github.sha }}
key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}:${{ github.ref_name }}
restore-keys: |
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref }}
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}
ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}
@@ -73,12 +74,12 @@ runs:
UBUNTU_VERSION="$(grep VERSION_ID /etc/os-release | cut -f2 -d\")"
source /etc/os-release
if [[ "$VERSION_CODENAME" == "jammy" ]]; then
if [[ "${{ inputs.cc }}" =~ "clang-" ]]; then
CLANG_VERSION="$(echo '${{ inputs.cc }}' | cut -f2 -d\-)"
if [[ "${{ inputs.CC }}" =~ "clang-" ]]; then
CLANG_VERSION="$(echo '${{ inputs.CC }}' | cut -f2 -d\-)"
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/$VERSION_CODENAME/ llvm-toolchain-$VERSION_CODENAME-$CLANG_VERSION main"
sudo apt-get -qq update
sudo apt-get -qq install '${{ inputs.cc }}'
sudo apt-get -qq install '${{ inputs.CC }}'
fi
fi
@@ -87,19 +88,44 @@ runs:
env:
CCACHE_DIR: $GITHUB_WORKSPACE/var/ccache
run: |
cat <<EOF >> $GITHUB_ENV
mkdir -p "$CCACHE_DIR"
cat <<EOF >> "$GITHUB_ENV"
CCACHE_BASEDIR=${GITHUB_WORKSPACE}
CCACHE_DIR=${{ env.CCACHE_DIR }}
CCACHE_MAXSIZE=1000MB
CCACHE_HASHDIR=1
CCACHE_MAXSIZE=5G
CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime
CCACHE_CPP2=true
CCACHE_COMPRESS=1
CCACHE_COMPRESSLEVEL=9
CCACHE_COMPILERCHECK=content
CCACHE_LOGFILE=$CCACHE_DIR/cache.debug
CCACHE_LOGFILE=${{ env.CCACHE_DIR }}/cache.debug
CC=${{ inputs.CC }}
CXX=${{ inputs.CXX }}
EOF
- name: ccache config snapshot
shell: bash
run: |
echo "==== Effective ccache configuration ===="
ccache -p | egrep 'base_dir|hash_dir|compiler_check|sloppiness|max_size' || true
echo
echo "==== Compiler info ===="
which ${{ inputs.CC }} && ${{ inputs.CC }} --version || true
which ${{ inputs.CXX }} && ${{ inputs.CXX }} --version || true
echo
echo "==== Previous cache stats ===="
ccache -s || true
echo
echo "==== Top cache results ===="
grep -o 'result: .*' "$CCACHE_DIR/cache.debug" 2>/dev/null | sort | uniq -c | sort -nr | head || true
- name: reset ccache stats
shell: bash
run: ccache -z || true
- name: Configure
shell: bash
run: |
@@ -107,6 +133,8 @@ runs:
mkdir build
cd build
cmake "$GITHUB_WORKSPACE" \
-DCMAKE_C_COMPILER="${{ inputs.CC }}" \
-DCMAKE_CXX_COMPILER="${{ inputs.CXX }}" \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/env/dist" \
-DAPPS_BUILD="all" \
-DTOOLS_BUILD=${{ inputs.tools }} \
@@ -116,8 +144,8 @@ runs:
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DCMAKE_C_FLAGS="-Werror ${{ startsWith(inputs.cc, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} " \
-DCMAKE_CXX_FLAGS="-Werror ${{ startsWith(inputs.cxx, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}}" \
-DCMAKE_C_FLAGS="-Werror ${{ startsWith(inputs.CC, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} -fdebug-prefix-map=${GITHUB_WORKSPACE}=." \
-DCMAKE_CXX_FLAGS="-Werror ${{ startsWith(inputs.CXX, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} -fdebug-prefix-map=${GITHUB_WORKSPACE}=." \
-DBUILD_TESTING="ON" \
-DUSE_SCRIPTPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \
-DUSE_COREPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \
@@ -190,3 +218,7 @@ runs:
else
exit 0
fi
- name: ccache stats
shell: bash
run: ccache -s || true

View File

@@ -10,9 +10,13 @@ on:
- synchronize
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
permissions:
actions: write
contents: read
jobs:
build:
strategy:

View File

@@ -10,9 +10,13 @@ on:
- synchronize
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
permissions:
actions: write
contents: read
jobs:
build:
strategy:

View File

@@ -19,8 +19,12 @@ on:
- 'src/server/shared/**/*'
- 'src/tools/**/*'
permissions:
actions: write
contents: read
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
jobs:

View File

@@ -16,9 +16,13 @@ on:
workflow_dispatch:
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
permissions:
actions: write
contents: read
env:
CONTINUOUS_INTEGRATION: true
MYSQL_ROOT_PASSWORD: root
@@ -72,6 +76,113 @@ jobs:
with:
fetch-depth: 1
- name: Install ccache
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y ccache
ccache --version
# Detect the compilers that acore.sh / CMake will end up using.
# We record both the binary name and a short version tag for the cache key.
- name: Detect compiler
id: detect
shell: bash
run: |
set -euo pipefail
CC_BIN="${CC:-}"
CXX_BIN="${CXX:-}"
[[ -z "$CC_BIN" ]] && CC_BIN="$(command -v clang || command -v gcc)"
[[ -z "$CXX_BIN" ]] && CXX_BIN="$(command -v clang++ || command -v g++)"
make_ver_id() {
local bin="$1"; local base="$(basename "$bin")"
case "$base" in
clang)
maj="$("$bin" -dumpversion 2>/dev/null | cut -d. -f1)"; [[ -z "$maj" ]] && maj="$( "$bin" --version | sed -n 's/.*version \([0-9][0-9]*\).*/\1/p' | head -1 )"
echo "clang-${maj:-unknown}"
;;
clang++)
maj="$("$bin" -dumpversion 2>/dev/null | cut -d. -f1)"; [[ -z "$maj" ]] && maj="$( "$bin" --version | sed -n 's/.*version \([0-9][0-9]*\).*/\1/p' | head -1 )"
echo "clang++-${maj:-unknown}"
;;
gcc)
maj="$("$bin" -dumpfullversion -dumpversion 2>/dev/null || "$bin" -dumpversion 2>/dev/null)"; maj="${maj%%.*}"
echo "gcc-${maj:-unknown}"
;;
g++)
maj="$("$bin" -dumpfullversion -dumpversion 2>/dev/null || "$bin" -dumpversion 2>/dev/null)"; maj="${maj%%.*}"
echo "g++-${maj:-unknown}"
;;
*)
echo "$base"
;;
esac
}
echo "cc_id=$(make_ver_id "$CC_BIN")" >> "$GITHUB_OUTPUT"
echo "cxx_id=$(make_ver_id "$CXX_BIN")" >> "$GITHUB_OUTPUT"
echo "Detected: $CC_BIN, $CXX_BIN"
- name: Prepare ccache dir
shell: bash
run: mkdir -p "${{ github.workspace }}/var/ccache"
- name: Echo cache key
shell: bash
run: echo "Cache key -> ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:${{ github.ref_name }}"
- name: Restore ccache
id: restore_ccache
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/var/ccache
key: ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:${{ github.ref_name }}
restore-keys: |
ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:true:pch=false:
ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:false:pch=false:
ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:true:pch=true:
ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:false:pch=true:
ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:true:
ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:false:
ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:
- name: Setup ccache env
shell: bash
env:
CCACHE_DIR: ${{ github.workspace }}/var/ccache
run: |
mkdir -p "$CCACHE_DIR"
cat <<EOF >> "$GITHUB_ENV"
CCACHE_BASEDIR=${{ github.workspace }}
CCACHE_DIR=${{ github.workspace }}/var/ccache
CCACHE_HASHDIR=1
CCACHE_MAXSIZE=5G
CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime
CCACHE_COMPRESS=1
CCACHE_COMPRESSLEVEL=9
CCACHE_COMPILERCHECK=content
CCACHE_LOGFILE=${{ github.workspace }}/var/ccache/cache.debug
CMAKE_C_COMPILER_LAUNCHER=ccache
CMAKE_CXX_COMPILER_LAUNCHER=ccache
EOF
- name: ccache snapshot (before)
shell: bash
run: |
echo "==== Effective ccache configuration ===="
ccache -p | egrep 'base_dir|hash_dir|compiler_check|sloppiness|max_size' || true
echo
echo "==== Previous cache stats ===="
ccache -s || true
echo
echo "==== Top cache results (from prior runs) ===="
grep -o 'result: .*' "${{ github.workspace }}/var/ccache/cache.debug" 2>/dev/null | sort | uniq -c | sort -nr | head || true
- name: Reset ccache stats
shell: bash
run: ccache -z || true
- name: Configure AzerothCore settings
run: |
touch conf/config.sh
@@ -154,3 +265,15 @@ jobs:
./acore.sh sm delete authserver
timeout-minutes: 30
continue-on-error: false
# save only if we didn't hit the cache
- name: Save ccache
if: steps.restore_ccache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/var/ccache
key: ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:${{ github.ref_name }}
- name: ccache stats (after)
shell: bash
run: ccache -s || true

View File

@@ -9,7 +9,7 @@ on:
- synchronize
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
env:
@@ -115,6 +115,6 @@ jobs:
event-type: azerothcore-new-images
client-payload: >
{
"ref": "${{ github.ref }}",
"ref": "${{ github.ref_name }}",
"sha": "${{ github.sha }}"
}

View File

@@ -6,9 +6,13 @@ on:
branches: [ "Playerbot" ]
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
permissions:
actions: write
contents: read
jobs:
macos-build:
strategy:
@@ -24,13 +28,19 @@ jobs:
uses: actions/cache@v4
with:
path: ~/Library/Caches/ccache
key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }}
key: ccache:${{ matrix.os }}:${{ github.ref_name }}
restore-keys: |
ccache:${{ matrix.os }}:${{ github.ref }}
ccache:${{ matrix.os }}:${{ github.ref_name }}
ccache:${{ matrix.os }}
- name: reset ccache stats
shell: bash
run: ccache -z || true
- name: Install latest bash
run: brew install bash
- name: Configure OS
run: source ./acore.sh install-deps
- name: Build
run: source ./apps/ci/mac/ci-compile.sh
- name: ccache stats
shell: bash
run: ccache -s || true

View File

@@ -9,7 +9,7 @@ on:
- synchronize
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
jobs:

View File

@@ -6,7 +6,7 @@ on:
branches: [ "Playerbot" ]
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }})
cancel-in-progress: true
jobs: