forked from ElunaLuaEngine/Eluna
-
Notifications
You must be signed in to change notification settings - Fork 147
83 lines (76 loc) · 2.6 KB
/
core-build-base.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Build mod-eluna base 🛠️
on:
workflow_call:
inputs:
lua_version:
required: true
type: string
jobs:
install_and_build:
runs-on: ubuntu-24.04
steps:
- name: Check out AzerothCore 🧑💻
uses: actions/checkout@v4
with:
repository: 'azerothcore/azerothcore-wotlk'
ref: 'master'
submodules: 'recursive'
fetch-depth: 0
- name: Check out module repository 📂
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: 'modules/${{ github.event.repository.name }}'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Cache compilation artifacts 💾
uses: actions/cache@v4
with:
path: var/ccache
key: ccache:${{ matrix.compiler.CC }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:clang-18:${{ github.ref }}
ccache:clang-18
- name: Install build dependencies 🧰
shell: bash
run: |
sudo apt update
sudo apt-get -y install ccache clang cmake curl google-perftools \
libmysqlclient-dev make unzip build-essential cmake-data \
libboost-all-dev libbz2-dev libncurses5-dev libmysql++-dev \
libreadline6-dev libssl-dev libtool openssl zlib1g-dev
- name: Build mod-eluna with ${{ inputs.lua_version }} 🏗️
run: |
rm -rf build
mkdir build && cd build
cmake .. \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DSCRIPTS="static" \
-DMODULES="static" \
-DWITH_WARNINGS="ON" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \
-DCMAKE_C_COMPILER_LAUNCHER="ccache" \
-DLUA_VERSION=${{ inputs.lua_version }}
make -j$(nproc)
cd ..
- name: Run Cppcheck for static code analysis 🔍
run: |
sudo apt update -y
sudo apt install -y cppcheck
cd modules/${{ github.event.repository.name }}
cppcheck -j$(nproc) --force --inline-suppr \
-I src/LuaEngine/ \
-I src/ \
--suppress=*:src/lualib/* \
--suppress=*:src/LuaEngine/libs/* \
--output-file=report.txt \
.
if [ -s report.txt ]; then
echo "Cppcheck detected issues 🚨:"
cat report.txt
exit 1
else
echo "No issues detected by cppcheck ✅."
fi