Skip to content

Commit 64f545d

Browse files
Add Hermes CI coverage (BabylonJS#1736)
## Summary - point JsRuntimeHost at the Hermes integration branch - add Win32 x64 D3D11 + Hermes CI - add Android + Hermes CI with host compiler import - add Ubuntu + Hermer CI ## Notes - Apple + Hermes is intentionally not added because shutdown currently aborts on macOS/iOS. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 158e2ef commit 64f545d

11 files changed

Lines changed: 90 additions & 34 deletions

File tree

.github/workflows/build-android.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,22 @@ jobs:
2929
distribution: temurin
3030
java-version: '17'
3131

32+
- name: Install Ninja (Hermes host-compiler bootstrap)
33+
if: inputs.js-engine == 'Hermes'
34+
run: |
35+
if [ "${{ runner.os }}" = "Linux" ]; then
36+
sudo apt-get update
37+
sudo apt-get install -y ninja-build
38+
elif [ "${{ runner.os }}" = "macOS" ] && ! command -v ninja >/dev/null 2>&1; then
39+
brew install ninja
40+
fi
41+
3242
- name: Build Playground ${{ inputs.js-engine }}
3343
working-directory: Apps/Playground/Android
3444
run: |
3545
chmod +x gradlew
3646
./gradlew assembleRelease \
37-
-PJSEngine=${{ inputs.js-engine }} \
47+
-PjsEngine=${{ inputs.js-engine }} \
3848
-PARM64Only \
3949
-PNDK_VERSION=${{ env.NDK_VERSION }} \
4050
-PSANITIZERS=OFF

.github/workflows/build-linux.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ env:
2727
jobs:
2828
build:
2929
runs-on: ubuntu-latest
30-
timeout-minutes: 30
30+
timeout-minutes: ${{ inputs.js-engine == 'Hermes' && 60 || 30 }}
3131
env:
3232
CC: ${{ inputs.cc }}
3333
CXX: ${{ inputs.cxx }}
@@ -49,6 +49,7 @@ jobs:
4949
-D BX_CONFIG_DEBUG=ON \
5050
-D OpenGL_GL_PREFERENCE=GLVND \
5151
-D BABYLON_DEBUG_TRACE=ON \
52+
${{ inputs.js-engine == 'Hermes' && '-D HERMES_UNICODE_LITE=ON -D HERMES_ALLOW_BOOST_CONTEXT=0' || '' }} \
5253
-D ENABLE_SANITIZERS=${{ inputs.enable-sanitizers && 'ON' || 'OFF' }} .
5354
ninja -C build/Linux
5455

.github/workflows/build-win32.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
elif [ "${{ inputs.napi-type }}" = "V8" ]; then
4545
SUFFIX="_V8"
4646
JS_DEFINE="-DNAPI_JAVASCRIPT_ENGINE=V8"
47+
elif [ "${{ inputs.napi-type }}" = "Hermes" ]; then
48+
SUFFIX="_Hermes"
49+
JS_DEFINE="-DNAPI_JAVASCRIPT_ENGINE=Hermes -DHERMES_ALLOW_BOOST_CONTEXT=0"
4750
fi
4851
echo "suffix=$SUFFIX" >> "$GITHUB_OUTPUT"
4952
echo "js_define=$JS_DEFINE" >> "$GITHUB_OUTPUT"

.github/workflows/ci.yml

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,36 @@ jobs:
1010
# ── Apple: macOS ──────────────────────────────────────────────
1111
MacOS:
1212
uses: ./.github/workflows/build-macos.yml
13+
with:
14+
xcode-version: "26.4"
15+
runs-on: macos-26
1316

1417
MacOS_Ninja:
1518
uses: ./.github/workflows/build-macos.yml
1619
with:
17-
generator: 'Ninja Multi-Config'
20+
generator: "Ninja Multi-Config"
21+
xcode-version: "26.4"
22+
runs-on: macos-26
1823

1924
MacOS_Sanitizers:
2025
uses: ./.github/workflows/build-macos.yml
2126
with:
2227
enable-sanitizers: true
23-
24-
# ── Apple: iOS ────────────────────────────────────────────────
25-
iOS_iOS180:
26-
uses: ./.github/workflows/build-ios.yml
27-
with:
28-
deployment-target: '18.0'
29-
30-
iOS_iOS175:
31-
uses: ./.github/workflows/build-ios.yml
32-
with:
33-
deployment-target: '17.5'
28+
xcode-version: "26.4"
29+
runs-on: macos-26
3430

3531
# ── Apple: Xcode 26 ──────────────────────────────────────────
3632
MacOS_Xcode26:
3733
uses: ./.github/workflows/build-macos.yml
3834
with:
39-
xcode-version: '26.4'
35+
xcode-version: "26.4"
4036
runs-on: macos-26
4137

4238
iOS_Xcode26:
4339
uses: ./.github/workflows/build-ios.yml
4440
with:
45-
deployment-target: '26.0'
46-
xcode-version: '26.4'
41+
deployment-target: "26.0"
42+
xcode-version: "26.4"
4743
runs-on: macos-26
4844

4945
# ── Win32─────────────────────────────────────────────────────
@@ -64,6 +60,12 @@ jobs:
6460
platform: x64
6561
napi-type: V8
6662

63+
Win32_x64_Hermes_D3D11:
64+
uses: ./.github/workflows/build-win32.yml
65+
with:
66+
platform: x64
67+
napi-type: Hermes
68+
6769
Win32_x64_D3D11_Sanitizers:
6870
uses: ./.github/workflows/build-win32.yml
6971
with:
@@ -104,6 +106,13 @@ jobs:
104106
cxx: clang++
105107
js-engine: JavaScriptCore
106108

109+
Ubuntu_Clang_Hermes:
110+
uses: ./.github/workflows/build-linux.yml
111+
with:
112+
cc: clang
113+
cxx: clang++
114+
js-engine: Hermes
115+
107116
Ubuntu_GCC_JSC:
108117
uses: ./.github/workflows/build-linux.yml
109118
with:
@@ -124,23 +133,29 @@ jobs:
124133
runs-on: ubuntu-latest
125134
js-engine: V8
126135

136+
Android_Ubuntu_Hermes:
137+
uses: ./.github/workflows/build-android.yml
138+
with:
139+
runs-on: ubuntu-latest
140+
js-engine: Hermes
141+
127142
Android_MacOS_JSC:
128143
uses: ./.github/workflows/build-android.yml
129144
with:
130-
runs-on: macos-latest
145+
runs-on: macos-26
131146
js-engine: JavaScriptCore
132147

133148
Android_MacOS_V8:
134149
uses: ./.github/workflows/build-android.yml
135150
with:
136-
runs-on: macos-latest
151+
runs-on: macos-26
137152
js-engine: V8
138153

139154
# ── Installation Tests ────────────────────────────────────────
140155
iOS_Installation:
141156
uses: ./.github/workflows/test-install-ios.yml
142157
with:
143-
deployment-target: '17.2'
158+
deployment-target: "17.2"
144159

145160
Linux_Installation:
146161
uses: ./.github/workflows/test-install-linux.yml

.github/workflows/test-install-ios.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ on:
99
xcode-version:
1010
required: false
1111
type: string
12-
default: '16.4'
12+
default: "26.4.1"
1313

1414
jobs:
1515
test-install:
16-
runs-on: macos-latest
16+
runs-on: macos-26
1717
timeout-minutes: 20
1818
steps:
1919
- uses: actions/checkout@v5
2020

21-
2221
- name: Select Xcode ${{ inputs.xcode-version }}
2322
run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer
2423

.github/workflows/test-install-macos.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ on:
66
xcode-version:
77
required: false
88
type: string
9-
default: '16.4'
9+
default: "26.4.1"
1010

1111
jobs:
1212
test-install:
13-
runs-on: macos-latest
13+
runs-on: macos-26
1414
timeout-minutes: 20
1515
steps:
1616
- uses: actions/checkout@v5
1717

18-
1918
- name: Select Xcode ${{ inputs.xcode-version }}
2019
run: sudo xcode-select --switch /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer
2120

Apps/ModuleLoadTest/Source/App.X11.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ namespace ModuleLoadTest
5656
"libexpat.so.1",
5757
"libgbm.so.1",
5858
"libgldispatch.so.0",
59+
"libicudata.so.74",
60+
"libicuuc.so.74",
61+
"liblzma.so.5",
5962
"libpciaccess.so.0",
6063
"libsensors.so.5",
6164
"libtinfo.so.6",

Apps/Playground/Android/BabylonNative/build.gradle

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ if (project.hasProperty("GRAPHICS_API")) {
1818

1919
def arcore_libpath = layout.buildDirectory.dir("arcore-native").get().asFile.absolutePath
2020

21+
def cmakeArguments = [
22+
"-DANDROID_STL=c++_shared",
23+
"-DENABLE_PCH=OFF",
24+
"-DGRAPHICS_API=${graphics_api}",
25+
"-DARCORE_LIBPATH=${arcore_libpath}/jni",
26+
"-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}",
27+
"-DBABYLON_NATIVE_BUILD_APPS=ON",
28+
"-DBABYLON_DEBUG_TRACE=ON"
29+
]
30+
// Hermes for Android needs HOST hermesc/shermes (they emit bytecode at build
31+
// time and can't run as NDK-cross-compiled binaries). JsRuntimeHost's CMake
32+
// bootstraps these host compilers automatically when cross-compiling, so no
33+
// hand-off is normally required. This property is an optional manual override:
34+
// pass -PimportHostCompilers=<ImportHostCompilers.cmake> to reuse a prebuilt
35+
// host-compiler set and skip the in-CMake bootstrap.
36+
if (project.hasProperty("importHostCompilers")) {
37+
cmakeArguments.add("-DIMPORT_HOST_COMPILERS=${project.property('importHostCompilers')}")
38+
}
39+
2140
configurations { natives }
2241

2342
android {
@@ -36,13 +55,7 @@ android {
3655
externalNativeBuild {
3756
cmake {
3857
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
39-
arguments "-DANDROID_STL=c++_shared",
40-
"-DENABLE_PCH=OFF",
41-
"-DGRAPHICS_API=${graphics_api}",
42-
"-DARCORE_LIBPATH=${arcore_libpath}/jni",
43-
"-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}",
44-
"-DBABYLON_NATIVE_BUILD_APPS=ON",
45-
"-DBABYLON_DEBUG_TRACE=ON"
58+
arguments(*cmakeArguments)
4659
cppFlags += ["-Wno-deprecated-literal-operator"]
4760
}
4861
}

Apps/Playground/Scripts/validation_native.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
}
8282

8383
const engine = new BABYLON.NativeEngine();
84+
globalThis.engine = engine;
8485
engine.getCaps().parallelShaderCompile = undefined;
8586

8687
// Broaden Babylon's default retry strategy for the test framework: in addition to
@@ -113,6 +114,7 @@
113114
}
114115

115116
const canvas = window;
117+
globalThis.canvas = canvas;
116118

117119
// Random replacement
118120
let seed = 1;

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ FetchContent_Declare(ios-cmake
5454
EXCLUDE_FROM_ALL)
5555
FetchContent_Declare(JsRuntimeHost
5656
GIT_REPOSITORY https://github.com/BabylonJS/JsRuntimeHost.git
57-
GIT_TAG 272f6a9f3de78f7c4cd8a838ae9655c81fc4881a)
57+
GIT_TAG f07d99119887131a89a3580ada9c2a8dbc7782f7)
5858
FetchContent_Declare(metal-cpp
5959
GIT_REPOSITORY https://github.com/bkaradzic/metal-cpp.git
6060
GIT_TAG metal-cpp_26

0 commit comments

Comments
 (0)