refactor: PlayerJoinEvent
#257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
permissions: read-all | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
build_type: [ Release ] | |
os: [ ubuntu-20.04, windows-2019 ] | |
include: | |
- os: ubuntu-20.04 | |
build_type: Debug | |
name: Build on ${{ matrix.os }} (${{ matrix.build_type }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache Conan | |
uses: actions/cache@v4 | |
with: | |
path: ~/.conan2/p | |
key: ${{ runner.os }}-conan-${{ matrix.build_type }}-${{ hashFiles('conanfile.py') }} | |
restore-keys: | | |
${{ runner.os }}-conan-${{ matrix.build_type }}- | |
${{ runner.os }}-conan- | |
${{ runner.os }}- | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Set up Clang (Linux) | |
if: runner.os == 'Linux' | |
env: | |
LLVM_VERSION: 16 | |
run: | | |
sudo apt-get update -y -q | |
sudo apt-get install -y -q build-essential lsb-release wget software-properties-common | |
sudo wget https://apt.llvm.org/llvm.sh | |
sudo chmod +x llvm.sh | |
sudo ./llvm.sh ${LLVM_VERSION} | |
sudo apt-get install -y -q libc++-${LLVM_VERSION}-dev libc++abi-${LLVM_VERSION}-dev | |
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 200 | |
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_VERSION} 200 | |
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${LLVM_VERSION} 100 | |
sudo update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-${LLVM_VERSION} 100 | |
echo "CC=clang" >> $GITHUB_ENV | |
echo "CXX=clang++" >> $GITHUB_ENV | |
- name: Set up MSVC (Windows) | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86_64 | |
- name: Set up CMake and Ninja | |
uses: lukka/get-cmake@latest | |
- name: Set up Conan | |
run: | | |
python -m pip install --upgrade pip | |
pip install conan | |
conan profile detect --force | |
- name: Install Dependencies with Conan (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
conan install . --build=missing -s compiler.cppstd=20 -s build_type=${{ matrix.build_type }} -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.libcxx=libc++ | |
- name: Install Dependencies with Conan (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
conan install . --build=missing -s compiler.cppstd=20 -s build_type=${{ matrix.build_type }} -c tools.cmake.cmaketoolchain:generator=Ninja | |
- name: Build with CMake | |
run: | | |
cd build/${{ matrix.build_type }} | |
cmake ../.. -G Ninja -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
cmake --build . | |
- name: Run Tests | |
run: ctest --test-dir build/${{ matrix.build_type }} |