rathena/.github/workflows/build_servers_vip.yml
2024-07-05 01:01:11 +00:00

83 lines
2.8 KiB
YAML

name: Build servers in VIP mode
# build_servers_vip.yml
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
paths:
# Always trigger all Github Actions if an action or something CI related was changed
- '.github/workflows/**'
- 'tools/ci/**'
# This workflow should run when a file in a source directory has been modified.
- 'src/**'
- '3rdparty/**'
# This workflow should run whenever a CMake related file has been modified
- '**/CMakeLists.txt'
jobs:
build:
# Github Actions checks for '[ci skip]', '[skip ci]', '[no ci]', '[skip actions]', or '[actions skip]' but not a hyphenated version.
# It's a catch-all incase a Pull Request has been opened and someone is on auto-pilot.
if: "!contains(github.event.head_commit.message, 'ci-skip')"
runs-on: ${{ matrix.os }}
strategy:
matrix:
# The ubuntu-latest label currently points to ubuntu-22.04.
# Available: ubuntu-22.04, ubuntu-20.04
os: [ubuntu-latest]
# We run build checks for both Renewal and PRE-Renewal
mode: ['PRE', 'RE']
steps:
- uses: actions/checkout@v4
# A simple 'yes' and 'no' can be confusing, so we use names to display in the current job then convert them for use in the compiler.
- name: Variable Parsing - PRE
if: ${{ matrix.mode == 'PRE' }}
run: |
echo "PRERE=ON" >> $GITHUB_ENV
- name: Variable Parsing - RE
if: ${{ matrix.mode == 'RE' }}
run: |
echo "PRERE=OFF" >> $GITHUB_ENV
- name: Update & Install packages
# Ubuntu runners already have most of the packages rAthena requires to build.
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
run: |
sudo apt update
sudo apt install zlib1g-dev libpcre3-dev
- name: Start MySQL
run: sudo systemctl start mysql.service
- name: Setup Database and import table data
run: ./tools/ci/sql.sh
- name: Create build directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: cmake .. -DENABLE_PRERENEWAL=${{env.PRERE}} -DENABLE_EXTRA_BUILDBOT_CODE=ON -DENABLE_VIP=ON
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . -j2 --target server
- name: Run Once - login-server
run: ./login-server --run-once
- name: Run Once - char-server
run: ./char-server --run-once
- name: Run Once - map-server
run: ./map-server --run-once