194 lines
6.1 KiB
YAML
194 lines
6.1 KiB
YAML
# Build on Ubuntu with GCC and Clang, plus Windows Visual Studio and MinGW64
|
|
# builds.
|
|
name: CI Build
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- '.github/ISSUE_TEMPLATE.md'
|
|
- '.github/ISSUE_TEMPLATE/**'
|
|
- '.github/PULL_REQUEST_TEMPLATE.md'
|
|
- '.github/workflows/development-db-dump.yaml'
|
|
- '.github/workflows/pr-sql-check.yaml'
|
|
- '.gitignore'
|
|
- 'CONTRIBUTING.md'
|
|
- 'LICENSE'
|
|
- 'README.md'
|
|
- 'sql/**'
|
|
|
|
pull_request:
|
|
paths-ignore:
|
|
- '.github/ISSUE_TEMPLATE.md'
|
|
- '.github/ISSUE_TEMPLATE/**'
|
|
- '.github/PULL_REQUEST_TEMPLATE.md'
|
|
- '.github/workflows/development-db-dump.yaml'
|
|
- '.github/workflows/pr-sql-check.yaml'
|
|
- '.gitignore'
|
|
- 'CONTRIBUTING.md'
|
|
- 'LICENSE'
|
|
- 'README.md'
|
|
- 'sql/**'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build on ${{ matrix.config.job_name }} (client build ${{ matrix.client_build }})
|
|
runs-on: ${{ matrix.config.os }}
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
# Every supported client build is verified against Ubuntu GCC; the
|
|
# latest (1.12.1.5875) additionally runs against Ubuntu Clang, Windows
|
|
# Visual Studio, and Windows MinGW (added via include below).
|
|
client_build:
|
|
- 5875
|
|
- 5464
|
|
- 5302
|
|
- 5086
|
|
- 4878
|
|
- 4695
|
|
- 4544
|
|
- 4449
|
|
- 4375
|
|
config:
|
|
- os: ubuntu-24.04
|
|
c_compiler: gcc
|
|
cxx_compiler: g++
|
|
job_name: Ubuntu GCC
|
|
pch_off: ""
|
|
include:
|
|
- client_build: 5875
|
|
config:
|
|
os: ubuntu-24.04
|
|
c_compiler: clang
|
|
cxx_compiler: clang++
|
|
install_clang: true
|
|
job_name: Ubuntu Clang & PCH OFF
|
|
pch_off: "-DUSE_PCH=OFF"
|
|
- client_build: 5875
|
|
config:
|
|
os: macos-26
|
|
job_name: macOS Clang
|
|
- client_build: 5875
|
|
config:
|
|
os: windows-2022
|
|
job_name: Windows Visual Studio
|
|
- client_build: 5875
|
|
config:
|
|
os: windows-2022
|
|
job_name: Windows MinGW
|
|
use_mingw: true
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install Ubuntu build dependencies
|
|
if: matrix.config.os == 'ubuntu-24.04'
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y --no-install-recommends \
|
|
build-essential \
|
|
cmake \
|
|
libcurl4-openssl-dev \
|
|
libmysqlclient-dev \
|
|
libssl-dev \
|
|
zlib1g-dev
|
|
|
|
- name: Install Clang compiler
|
|
if: matrix.config.install_clang
|
|
run: sudo apt install -y --no-install-recommends clang
|
|
|
|
- name: Install macOS build dependencies
|
|
# Pinned to match the macOS release build's dependencies so this job
|
|
# actually validates the configuration we ship; see the
|
|
# `Install macOS build dependencies` step in
|
|
# `.github/workflows/development-release.yaml` for the reasoning.
|
|
if: matrix.config.os == 'macos-26'
|
|
run: brew install openssl@3 mysql-client@8.4
|
|
|
|
- name: Set up MSYS2 (MINGW64)
|
|
if: matrix.config.use_mingw
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
msystem: MINGW64
|
|
update: true
|
|
install: >-
|
|
base-devel
|
|
git
|
|
mingw-w64-x86_64-cmake
|
|
mingw-w64-x86_64-curl
|
|
mingw-w64-x86_64-gcc
|
|
mingw-w64-x86_64-ninja
|
|
|
|
- name: Build and install on Ubuntu
|
|
if: matrix.config.os == 'ubuntu-24.04'
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p build _install
|
|
cd build
|
|
cmake ../ \
|
|
-DCMAKE_C_COMPILER="${{ matrix.config.c_compiler }}" \
|
|
-DCMAKE_CXX_COMPILER="${{ matrix.config.cxx_compiler }}" \
|
|
-DCMAKE_INSTALL_PREFIX="../_install" \
|
|
-DBUILD_EXTRACTORS=1 \
|
|
-DENABLE_MAILSENDER=1 \
|
|
-DBUILD_WARNINGS_AS_ERROR=1 \
|
|
-DSUPPORTED_CLIENT_BUILD="${{ matrix.client_build }}" \
|
|
${{ matrix.config.pch_off }}
|
|
make -j"$(nproc)"
|
|
make install
|
|
|
|
- name: Build and install on macOS
|
|
if: matrix.config.os == 'macos-26'
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p build _install
|
|
cd build
|
|
cmake ../ \
|
|
-DCMAKE_INSTALL_PREFIX="../_install" \
|
|
-DCMAKE_PREFIX_PATH="$(brew --prefix openssl@3);$(brew --prefix mysql-client@8.4)" \
|
|
-DBUILD_EXTRACTORS=1 \
|
|
-DENABLE_MAILSENDER=1 \
|
|
-DBUILD_WARNINGS_AS_ERROR=1 \
|
|
-DSUPPORTED_CLIENT_BUILD="${{ matrix.client_build }}"
|
|
make -j"$(sysctl -n hw.ncpu)"
|
|
make install
|
|
|
|
- name: Build and install on Windows (Visual Studio)
|
|
if: matrix.config.os == 'windows-2022' && !matrix.config.use_mingw
|
|
shell: bash # Windows runners default to PowerShell.
|
|
run: |
|
|
set -euo pipefail
|
|
# Build cURL.
|
|
cd "$GITHUB_WORKSPACE/dep/windows/optional_dependencies"
|
|
./curl_download_and_build.bat
|
|
# Build VMaNGOS.
|
|
cd "$GITHUB_WORKSPACE"
|
|
mkdir -p build
|
|
cd build
|
|
cmake ../ \
|
|
-DBUILD_EXTRACTORS=1 \
|
|
-DENABLE_MAILSENDER=1 \
|
|
-DBUILD_WARNINGS_AS_ERROR=1 \
|
|
-DSUPPORTED_CLIENT_BUILD="${{ matrix.client_build }}" \
|
|
-G "Visual Studio 17 2022" \
|
|
-A x64
|
|
"/c/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" "MaNGOS.sln" //p:Platform=x64 //p:Configuration=Release //m
|
|
|
|
- name: Build and install on Windows (MinGW)
|
|
if: matrix.config.use_mingw
|
|
shell: msys2 {0}
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p build
|
|
cd build
|
|
cmake ../ \
|
|
-DBUILD_EXTRACTORS=1 \
|
|
-DENABLE_MAILSENDER=1 \
|
|
-DBUILD_WARNINGS_AS_ERROR=1 \
|
|
-DSUPPORTED_CLIENT_BUILD="${{ matrix.client_build }}" \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-G Ninja
|
|
cmake --build . --parallel
|