VoxelEngine/.github/workflows/windows-clang.yml
2024-12-21 10:23:06 +03:00

75 lines
2.3 KiB
YAML

name: Windows Build (CLang)
on:
push:
branches: [ "main", "release-**"]
pull_request:
branches: [ "main", "headless-mode" ]
jobs:
build-windows:
strategy:
matrix:
include:
- os: windows-latest
compiler: clang
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- uses: msys2/setup-msys2@v2
id: msys2
name: Setup MSYS2
with:
msystem: clang64
install: >-
mingw-w64-clang-x86_64-toolchain
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-ninja
mingw-w64-clang-x86_64-luajit
git
- name: Bootstrap vcpkg
shell: msys2 {0}
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg integrate install
- name: Configure project with CMake and vcpkg
shell: msys2 {0}
env:
VCPKG_ROOT: ./vcpkg
VCPKG_DEFAULT_TRIPLET: x64-mingw-static
VCPKG_DEFAULT_HOST_TRIPLET: x64-mingw-static
run: |
cmake --preset default-ninja-clang-windows -DVCPKG_TARGET_TRIPLET=x64-mingw-static
cmake --build --preset default-ninja-clang-windows --config Release
- name: Package for Windows
run: |
mkdir packaged
mkdir packaged/res
cp build/Release/VoxelEngine.exe packaged/
cp build/vctest/Release/vctest.exe packaged/
cp build/*.dll packaged/
cp -r build/Release/res/* packaged/res/
mv packaged/VoxelEngine.exe packaged/VoxelCore.exe
- env:
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
name: Add lua51.dll to the package
run: |
cp $env:MSYS2_LOCATION/clang64/bin/lua51.dll ${{ github.workspace }}/packaged/
working-directory: ${{ github.workspace }}
- uses: actions/upload-artifact@v4
with:
name: Windows-Build
path: 'packaged/*'
- name: Run engine tests
shell: msys2 {0}
working-directory: ${{ github.workspace }}
run: |
packaged/vctest.exe -e packaged/VoxelCore.exe -d dev/tests -u build --output-always