mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-19 16:52:25 +00:00
98 lines
2.7 KiB
YAML
98 lines
2.7 KiB
YAML
name: Build
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
linux:
|
|
name: Linux
|
|
runs-on: ubuntu-latest
|
|
container: akkadius/eqemu-server:v16
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 0
|
|
|
|
- name: Mark workspace safe
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
- name: Build
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
mkdir -p build && cd build
|
|
cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
|
|
make -j"$(nproc)"
|
|
|
|
- name: Package linux binaries
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
install -d /tmp/package-bin
|
|
for bin in world zone ucs loginserver queryserv shared_memory eqlaunch; do
|
|
if [ ! -f "build/bin/${bin}" ]; then
|
|
echo "Missing binary: ${bin}"
|
|
exit 1
|
|
fi
|
|
cp "build/bin/${bin}" "/tmp/package-bin/${bin}"
|
|
chmod +x "/tmp/package-bin/${bin}"
|
|
done
|
|
tar -czf "$GITHUB_WORKSPACE/eqemu-linux-bins.tgz" -C /tmp/package-bin .
|
|
|
|
- name: Smoke test linux binaries
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
mkdir -p /tmp/bin
|
|
tar -xzf eqemu-linux-bins.tgz -C /tmp/bin
|
|
missing_libs="$(ldd /tmp/bin/world | grep "not found" || true)"
|
|
if [ -n "$missing_libs" ]; then
|
|
echo "Missing shared libraries:"
|
|
echo "$missing_libs"
|
|
exit 1
|
|
fi
|
|
/tmp/bin/world --help
|
|
|
|
- name: Upload linux binaries
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-bins
|
|
path: ${{ github.workspace }}/eqemu-linux-bins.tgz
|
|
|
|
windows:
|
|
name: Windows
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v5
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Enable long paths
|
|
run: git config --global core.longpaths true
|
|
|
|
- name: Setup MSVC environment
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: x64
|
|
|
|
- name: Configure
|
|
shell: pwsh
|
|
run: |
|
|
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
|
-DEQEMU_BUILD_TESTS=ON `
|
|
-DEQEMU_BUILD_LOGIN=ON `
|
|
-DEQEMU_BUILD_LUA=ON `
|
|
-DEQEMU_BUILD_ZLIB=ON `
|
|
-DEQEMU_BUILD_CLIENT_FILES=ON
|
|
|
|
- name: Build
|
|
shell: pwsh
|
|
run: cmake --build build --config RelWithDebInfo --target ALL_BUILD -- /m
|
|
|
|
- name: Test
|
|
working-directory: build
|
|
run: ./bin/RelWithDebInfo/tests.exe
|