Skip to content

Commit

Permalink
[CI] Added CIS build script for WebAssembly.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBanana committed Sep 14, 2024
1 parent 3ece941 commit 10de2ee
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 1 deletion.
71 changes: 71 additions & 0 deletions .github/workflows/ci_wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: WebAssembly

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build_android:
strategy:
matrix:
config: [Release, Debug]
fail-fast: false

runs-on: ubuntu-latest

env:
ANDROID_API_LEVEL: 28
README: ${{ github.workspace }}/README.txt
GAUSSIAN_LIB_DIR: external/GaussianLib/include
EMSDK_CACHE_DIR: 'emsdk-cache'
EMSDK_CMAKE_DIR: 'upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake'

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Dependencies (Emscripten SDK)
uses: mymindstorm/setup-emsdk@v14
with:
actions-cache-folder: ${{env.EMSDK_CACHE_DIR}}

- name: Configure CMake
run: >
cmake -S . -B ${{github.workspace}}/WebAssembly
-DCMAKE_TOOLCHAIN_FILE="${{ env.EMSDK_CACHE_DIR }}/${{ env.EMSDK_CMAKE_DIR }}"
-DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DLLGL_BUILD_STATIC_LIB=ON
-DLLGL_BUILD_RENDERER_WEBGL=ON
-DLLGL_GL_ENABLE_OPENGL2X=OFF
-DLLGL_BUILD_RENDERER_NULL=OFF
-DLLGL_BUILD_RENDERER_VULKAN=OFF
-DLLGL_BUILD_RENDERER_DIRECT3D11=OFF
-DLLGL_BUILD_RENDERER_DIRECT3D12=OFF
-DLLGL_BUILD_EXAMPLES=ON
-DLLGL_BUILD_TESTS=OFF
-DGaussLib_INCLUDE_DIR:STRING="${{ env.GAUSSIAN_LIB_DIR }}"
- name: Build
run: |
cmake --build ${{github.workspace}}/WebAssembly --config ${{ matrix.config }}
CURRENT_TIME=$(date)
echo "LLGL built for HTML5/WebAssembly on $CURRENT_TIME." > ${{ env.README }}
- name: Generate HTML5 pages
if: matrix.config == 'Release'
run: |
scripts/GenerateHTML5Examples.sh . "${{github.workspace}}/WebAssembly" --verbose
- name: Upload Binaries
uses: actions/upload-artifact@v4
if: matrix.config == 'Release'
with:
name: LLGL-WebAssembly
path: |
${{ env.README }}
${{ github.workspace }}/WebAssembly/html5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ with Introduction, Hello Triangle Tutorial, and Extensibility Example with [GLFW
| <img src="docu/Icons/macos.svg" height="20" /> macOS | [![macOS CI](https://github.com/LukasBanana/LLGL/actions/workflows/ci_macos.yml/badge.svg)](https://github.com/LukasBanana/LLGL/actions/workflows/ci_macos.yml) | N/A | N/A | N/A | :heavy_check_mark: | :heavy_check_mark: |
| <img src="docu/Icons/ios.svg" height="20" /> iOS | [![iOS CI](https://github.com/LukasBanana/LLGL/actions/workflows/ci_ios.yml/badge.svg)](https://github.com/LukasBanana/LLGL/actions/workflows/ci_ios.yml) | N/A | N/A | N/A | :heavy_check_mark: | :heavy_check_mark: |
| <img src="docu/Icons/android.svg" height="20" /> Android | [![Android CI](https://github.com/LukasBanana/LLGL/actions/workflows/ci_android.yml/badge.svg)](https://github.com/LukasBanana/LLGL/actions/workflows/ci_android.yml) | N/A | N/A | :heavy_check_mark: | :heavy_check_mark: | N/A |
| <img src="docu/Icons/wasm.svg" height="20" /> Wasm | | N/A | N/A | N/A | :heavy_check_mark: | N/A |
| <img src="docu/Icons/wasm.svg" height="20" /> Wasm | [![WebAssembly CI](https://github.com/LukasBanana/LLGL/actions/workflows/ci_wasm.yml/badge.svg)](https://github.com/LukasBanana/LLGL/actions/workflows/ci_wasm.yml) | N/A | N/A | N/A | :heavy_check_mark: | N/A |


## Build Notes
Expand Down

0 comments on commit 10de2ee

Please sign in to comment.