[CI] Added CIS build script for WebAssembly. #580
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: MS Windows | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build_windows: | |
strategy: | |
matrix: | |
generator: [Visual Studio 17 2022, Visual Studio 16 2019] | |
arch: [x64, Win32] | |
lib: [Shared, Static] | |
config: [Release, Debug] | |
fail-fast: false | |
runs-on: ${{ matrix.generator == 'Visual Studio 17 2022' && 'windows-latest' || 'windows-2019' }} | |
env: | |
README: ${{ github.workspace }}/README.txt | |
CONFIG: ${{ matrix.config == 'Debug' && 'Debug' || 'RelWithDebInfo' }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Configure CMake | |
run: > | |
cmake -G "${{ matrix.generator }}" -A "${{ matrix.arch }}" -S . -B ${{ github.workspace }}/${{ matrix.arch }} | |
-DLLGL_BUILD_STATIC_LIB=${{ matrix.lib == 'Static' && 'ON' || 'OFF' }} | |
-DLLGL_BUILD_RENDERER_OPENGL=ON | |
-DLLGL_BUILD_RENDERER_DIRECT3D11=ON | |
-DLLGL_BUILD_RENDERER_DIRECT3D12=ON | |
-DLLGL_BUILD_EXAMPLES=ON | |
-DLLGL_BUILD_TESTS=ON | |
-DLLGL_BUILD_WRAPPER_C99=ON | |
-DLLGL_BUILD_WRAPPER_CSHARP=ON | |
-DLLGL_VK_ENABLE_SPIRV_REFLECT=ON | |
-DLLGL_GL_ENABLE_OPENGL2X=ON | |
"-DLLGL_D3D11_ENABLE_FEATURELEVEL=${{ matrix.generator == 'Visual Studio 17 2022' && 'Direct3D 11.3' || 'Direct3D 11.0' }}" | |
"-DLLGL_D3D12_ENABLE_FEATURELEVEL=${{ matrix.generator == 'Visual Studio 17 2022' && 'Direct3D 12.2' || 'Direct3D 12.0' }}" | |
- name: Build | |
run: | | |
cmake --build ${{ github.workspace }}/${{ matrix.arch }} --config ${{ env.CONFIG }} | |
echo "LLGL built with ${{ matrix.generator }} for ${{ matrix.arch }} on $(date)." > ${{ env.README }} | |
echo "Place at root of LLGL repository to run examples and testbed." >> ${{ env.README }} | |
- name: Upload Binaries | |
uses: actions/upload-artifact@v4 | |
if: matrix.generator == 'Visual Studio 17 2022' && matrix.lib == 'Shared' && matrix.config == 'Release' | |
with: | |
name: LLGL-Windows-${{ matrix.config }}-${{ matrix.arch == 'x64' && 'x86_64' || 'x86' }} | |
path: | | |
${{ env.README }} | |
${{ github.workspace }}/${{ matrix.arch }}/build/${{ matrix.config }}/LLGL*.dll | |
${{ github.workspace }}/${{ matrix.arch }}/build/${{ matrix.config }}/Example_*.exe | |
${{ github.workspace }}/${{ matrix.arch }}/build/${{ matrix.config }}/Testbed*.exe | |
- name: Testbed | |
working-directory: tests/Testbed | |
run: | | |
${{ github.workspace }}/${{ matrix.arch }}/build/${{ env.CONFIG }}/${{ matrix.config == 'Debug' && 'TestbedD' || 'Testbed' }}.exe d3d12 -v -f -t -g ${{ matrix.config == 'Debug' && '-d=gpu' || '' }} | |
- name: Upload Test Report | |
uses: actions/upload-artifact@v4 | |
if: always() && matrix.generator == 'Visual Studio 17 2022' && matrix.arch == 'x64' && matrix.lib == 'Shared' && matrix.config == 'Release' | |
with: | |
name: LLGL-Win64-Test_Report | |
path: | | |
tests/Testbed/Output/Direct3D12/*.png | |
tests/Testbed/Output/Direct3D12/Report.txt | |