Add emscripten build to CI
authorNathaniel Cesario <nathaniel@lunarg.com>
Tue, 1 Aug 2023 23:53:23 +0000 (17:53 -0600)
committerarcady-lunarg <122813703+arcady-lunarg@users.noreply.github.com>
Wed, 2 Aug 2023 22:43:05 +0000 (16:43 -0600)
Adds a build-only (no test) job for testing the emscripten (web) build
on github actions.

.github/workflows/continuous_integration.yml
README.md

index 2de827b..4b72962 100644 (file)
@@ -227,3 +227,27 @@ jobs:
                 CMAKE_CXX_COMPILER_LAUNCHER: ccache
             - name: Build
               run: cmake --build build/
+
+    emscripten:
+        runs-on: ubuntu-22.04
+        steps:
+            - uses: actions/checkout@v3
+            - uses: actions/setup-python@v4
+              with:
+                  python-version: '3.7'
+            - uses: lukka/get-cmake@latest
+            - name: Setup ccache
+              uses: hendrikmuhs/ccache-action@v1.2
+              with:
+                  key: ubuntu-emscripten
+            - uses: mymindstorm/setup-emsdk@v11
+            - name: Update Glslang Sources
+              run: ./update_glslang_sources.py
+            - name: Configure
+              run: emcmake cmake -GNinja -Bbuild/web -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON -DBUILD_TESTING=OFF -DENABLE_OPT=OFF
+              env:
+                CMAKE_GENERATOR: Ninja
+                CMAKE_C_COMPILER_LAUNCHER: ccache
+                CMAKE_CXX_COMPILER_LAUNCHER: ccache
+            - name: Build
+              run: cmake --build build/web
index d153fa9..f5b8ef6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -250,7 +250,7 @@ Use the steps in [Build Steps](#build-steps), with the following notes/exception
   Bash-like environments:
   + [Instructions located here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install)
 * Wrap cmake call: `emcmake cmake`
-* Set `-DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF`.
+* Set `-DBUILD_TESTING=OFF -DENABLE_OPT=OFF`.
 * Set `-DENABLE_HLSL=OFF` if HLSL is not needed.
 * For a standalone JS/WASM library, turn on `-DENABLE_GLSLANG_JS=ON`.
 * To get a fully minimized build, make sure to use `brotli` to compress the .js
@@ -260,7 +260,7 @@ Example:
 
 ```sh
 emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON \
-    -DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF ..
+    -DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF ..
 ```
 
 ## Building glslang - Using vcpkg