Skip to content

Merge pull request #2516 from mod-playerbots/test-staging #19

Merge pull request #2516 from mod-playerbots/test-staging

Merge pull request #2516 from mod-playerbots/test-staging #19

Workflow file for this run

name: windows-build
on:
push:
branches: [ "master", "test-staging" ]
pull_request:
branches: [ "master", "test-staging" ]
concurrency:
group: "windows-build-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true
jobs:
windows-build:
strategy:
fail-fast: false
matrix:
os: [windows-2022]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}
env:
BOOST_ROOT: C:\local\boost_1_87_0
CMAKE_GENERATOR: Ninja
CTOOLS_BUILD: all
steps:
- name: Checkout AzerothCore
uses: actions/checkout@v4
with:
repository: 'mod-playerbots/azerothcore-wotlk'
ref: ${{ (github.base_ref || github.ref_name) == 'test-staging' && 'test-staging' || 'Playerbot' }}
path: a
- name: Checkout Playerbot Module
uses: actions/checkout@v4
with:
repository: 'mod-playerbots/mod-playerbots'
path: a/modules/mod-playerbots
- name: Move source tree to short path
shell: powershell
run: |
if (Test-Path C:\ac) {
Remove-Item C:\ac -Recurse -Force
}
New-Item -ItemType Directory -Path C:\ac | Out-Null
robocopy "${{ github.workspace }}\a" "C:\ac" /MIR /NFL /NDL /NJH /NJS /NP
if ($LASTEXITCODE -le 7) {
exit 0
}
exit $LASTEXITCODE
- name: Install Boost and Ninja
shell: powershell
run: |
choco install ninja -y --no-progress
choco install boost-msvc-14.3 --version=1.87.0 -y --no-progress
- name: Prepare OpenSSL from runner image
shell: powershell
run: |
$candidates = @(
"C:\Program Files\OpenSSL",
"C:\Program Files\OpenSSL-Win64"
)
$opensslRoot = $null
foreach ($candidate in $candidates) {
if ((Test-Path "$candidate\bin\openssl.exe") -and (Test-Path "$candidate\include\openssl\ssl.h")) {
$opensslRoot = $candidate
break
}
}
if (-not $opensslRoot) {
Write-Host "OpenSSL candidates checked:"
$candidates | ForEach-Object { Write-Host " - $_" }
throw "OpenSSL development files not found on runner image"
}
if (Test-Path C:\openssl) {
Remove-Item C:\openssl -Recurse -Force
}
New-Item -ItemType Junction -Path C:\openssl -Target $opensslRoot | Out-Null
"OPENSSL_ROOT_DIR=C:\openssl" >> $env:GITHUB_ENV
"OPENSSL_DIR=C:\openssl" >> $env:GITHUB_ENV
"PATH=C:\openssl\bin;$env:PATH" >> $env:GITHUB_ENV
C:\openssl\bin\openssl.exe version
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.13
- name: Create AzerothCore CI config
shell: bash
working-directory: C:\ac
run: |
mkdir -p conf
cat > conf/config.sh <<'EOF'
CCOMPILERC="cl"
CCOMPILERCXX="cl"
CTYPE="Release"
CSCRIPTS="static"
CMODULES="static"
CTOOLS_BUILD="all"
CCUSTOMOPTIONS="-DBOOST_ROOT=C:/local/boost_1_87_0 -DOPENSSL_ROOT_DIR=C:/openssl -DOPENSSL_USE_STATIC_LIBS=FALSE -DCMAKE_RC_COMPILER=rc -DCMAKE_NINJA_FORCE_RESPONSE_FILE=ON -DCMAKE_NINJA_CMCLDEPS_RC=OFF -DCMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS=ON -DCMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON -DCMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES=ON -DCMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES=ON -DCMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES=ON -DCMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES=ON"
EOF
cat conf/config.sh
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: x64
- name: Build
shell: bash
working-directory: C:\ac
run: |
export CTOOLS_BUILD=all
export CMAKE_GENERATOR=Ninja
export CC=cl
export CXX=cl
export RC=rc
cmake --version
ninja --version
echo "CMAKE_GENERATOR=$CMAKE_GENERATOR"
echo "CC=$CC"
echo "CXX=$CXX"
echo "BOOST_ROOT=$BOOST_ROOT"
echo "OPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR"
which cl || true
which rc || true
which openssl || true
cl || true
rc || true
openssl version || true
rm -rf var/build/obj
./acore.sh compiler build