Skip to content

Logic refactor

Logic refactor #5

Workflow file for this run

name: Build GameServer
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
build-windows:
runs-on: windows-latest
strategy:
matrix:
arch: [x64]
config: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: '3.24'
- name: Setup Visual Studio
uses: microsoft/setup-msbuild@v1
- name: Create build directory
run: mkdir build
- name: Configure CMake (Windows)
working-directory: build
run: cmake .. -G "Visual Studio 17 2022" -A x64 -DTARGET_ARCH=x64
- name: Build (Windows)
working-directory: build
run: cmake --build . --config ${{ matrix.config }}
- name: Run tests (Windows)
working-directory: build
run: ctest -C ${{ matrix.config }} --output-on-failure
- name: Upload Windows artifacts
if: matrix.config == 'Release'
uses: actions/upload-artifact@v4
with:
name: gameserver-windows-x64
path: build/_output/windows_x64/
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x64]
config: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake build-essential
- name: Create build directory
run: mkdir build
- name: Configure CMake (Linux)
working-directory: build
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DTARGET_ARCH=x64
- name: Build (Linux)
working-directory: build
run: cmake --build . --config ${{ matrix.config }} --parallel $(nproc)
- name: Run tests (Linux)
working-directory: build
run: ctest --output-on-failure
- name: Upload Linux artifacts
if: matrix.config == 'Release'
uses: actions/upload-artifact@v4
with:
name: gameserver-linux-x64
path: build/_output/linux_x64/