Build analyze work

This commit is contained in:
Chris Miles 2025-06-22 02:09:16 -05:00
parent fc470d5f83
commit 605e23e8d0
2 changed files with 76 additions and 1 deletions

View File

@ -30,6 +30,11 @@ steps:
- name: cache
path: /home/eqemu/.ccache/
trigger:
branch:
exclude:
- build-analyze
---
kind: pipeline
@ -57,6 +62,11 @@ steps:
commands:
- .\utils\scripts\build\windows-build.ps1
trigger:
branch:
exclude:
- build-analyze
---
kind: pipeline
@ -87,7 +97,10 @@ steps:
trigger:
branch:
- master
include:
- master
exclude:
- build-analyze
event:
- push
@ -95,4 +108,23 @@ depends_on:
- Build Windows
- Build Linux
---
kind: pipeline
type: docker
name: Build Analyze
steps:
- name: Build Linux X64
image: akkadius/eqemu-server:v16
environment:
GITHUB_TOKEN:
from_secret: GH_RELEASE_GITHUB_API_TOKEN
commands:
- ./utils/scripts/build/linux-build-analyze.sh
trigger:
branch:
- build-analyze
event:
- push

View File

@ -0,0 +1,43 @@
#!/bin/bash
set -ex
sudo chown eqemu:eqemu /drone/src/ * -R
# Install ClangBuildAnalyzer if missing
if ! command -v clang-build-analyzer &> /dev/null; then
echo "Installing latest Clang Build Analyzer..."
LATEST_VERSION=$(curl -s https://api.github.com/repos/aras-p/ClangBuildAnalyzer/releases/latest \
| grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
sudo curl -sSL "https://github.com/aras-p/ClangBuildAnalyzer/releases/download/v${LATEST_VERSION}/ClangBuildAnalyzer-linux" \
-o /usr/local/bin/clang-build-analyzer
sudo chmod +x /usr/local/bin/clang-build-analyzer
fi
git submodule init && git submodule update
perl utils/scripts/build/tag-version.pl
mkdir -p build
clang-build-analyzer --start build/
cd build && \
cmake -DEQEMU_BUILD_TESTS=ON \
-DEQEMU_BUILD_LUA=ON \
-DEQEMU_BUILD_PERL=ON \
-DEQEMU_BUILD_LOGIN=ON \
-DEQEMU_BUILD_STATIC=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_FLAGS:STRING="-O0 -g -Wno-everything -ftime-trace" \
-G 'Unix Makefiles' \
.. && \
make -j"$(nproc)"
# 🧠 Generate ClangBuildAnalyzer report
clang-build-analyzer --stop ./ /tmp/eqemu.capture
clang-build-analyzer --analyze /tmp/eqemu.capture > report.txt
cat report.txt
ldd ./bin/zone
cd /drone/src/