Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/actions/install-cmake/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Install CMake
runs:
using: composite
steps:
- name: Install CMake
shell: bash
run: |-
if ! brew list cmake &> /dev/null; then
echo "Installing CMake"
brew install cmake
fi
5 changes: 5 additions & 0 deletions .github/workflows/rn-build-hermes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ jobs:
secrets: inherit
with:
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
test-apple-runtime:
needs: build_hermes_macos
uses: ./.github/workflows/test-apple-runtime.yml
run-tests:
uses: ./.github/workflows/run-tests.yml
publish:
uses: ./.github/workflows/publish.yml
secrets: inherit
Expand Down
222 changes: 222 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
name: run-tests

on:
workflow_call

jobs:
test-macos:
runs-on: macos-15
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.2
- uses: actions/checkout@v4.1.0
with:
path: hermes
- name: Install CMake
uses: ./hermes/.github/actions/install-cmake
- name: Run MacOS regression tests in debug mode
run: |-
cmake -S hermes -B build -GXcode -DCMAKE_BUILD_TYPE=Release
cmake --build ./build
cmake --build ./build --target check-hermes
test-linux:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |-
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libicu-dev zip python3
- uses: actions/checkout@v4.1.0
with:
path: hermes
- name: Run Hermes regression tests
run: |-
cmake -S hermes -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target check-hermes all -j 4
test-windows:
runs-on: wina dows-2025
steps:
- uses: actions/checkout@v4.1.0
with:
path: hermes
- name: Run Hermes regression tests
run: |-
cmake -S hermes -B build -G 'Visual Studio 17 2022'
cmake --build build --target check-hermes -- -m /p:UseMultiToolTask=true -m /p:EnforceProcessCountAcrossBuilds=true
test-e2e:
runs-on: ubuntu-22.04
env:
ANDROID_NDK: /usr/local/lib/android/sdk/ndk/27.1.12297006
HERMES_WS_DIR: /home/runner/work/hermes
REACT_NATIVE_OVERRIDE_HERMES_DIR: /home/runner/work/hermes/hermes
CMAKE_VERSION: 3.22.1
steps:
- name: Install Node
uses: actions/setup-node@v4.0.2
with:
node-version: 24
- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Checkout Hermes
uses: actions/checkout@v4.1.0
- name: Checkout React Native
run: |-
cd "$HERMES_WS_DIR"
git clone --depth=1 https://github.com/facebook/react-native
cd react-native
yarn install
echo "console.log('Using Hermes: ' + (global.HermesInternal != null));" >> packages/rn-tester/js/RNTesterApp.android.js
- name: Run RNTester
uses: ReactiveCircus/android-emulator-runner@v2.30.1
with:
api-level: 29
ndk: 27.1.12297006
cmake: 3.22.1
script: |
cd ../react-native && ./gradlew -PreactNativeArchitectures=x86 :packages:rn-tester:android:app:installRelease
adb shell am start com.facebook.react.uiapp/.RNTesterActivity
timeout 30s adb logcat -e "Using Hermes: true" -m 1
test-e2e-intl:
runs-on: ubuntu-22.04
env:
HERMES_WS_DIR: /home/runner/work/hermes
ANDROID_NDK: /usr/local/lib/android/sdk/ndk/27.1.12297006
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- name: Checkout Hermes
uses: actions/checkout@v4.1.0
- name: Checkout Test262
run: |-
cd "$HERMES_WS_DIR"
git clone https://github.com/tc39/test262
cd test262
git checkout 62626e083bd506124aac6c799464d76c2c42851b
- name: Build Hermes Compiler
run: |-
cd "$HERMES_WS_DIR"
cmake -S hermes -B ./build -DCMAKE_BUILD_TYPE=Release
cmake --build ./build -j 4 --target hermesc
- name: Run android tests
id: tests
uses: ReactiveCircus/android-emulator-runner@v2.30.1
with:
api-level: 29
emulator-options: -timezone Europe/Paris -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: |
adb logcat -c
touch ./emulator.log
chmod 777 ./emulator.log
adb logcat >> ./emulator.log &
cd android && ./gradlew :intltest:prepareTests && ./gradlew -Pabis=x86 :intltest:connectedAndroidTest
- name: Upload emulator log
if: always()
uses: actions/upload-artifact@v4.3.4
with:
name: emulator.log
path: emulator.log
test-macos-test262:
runs-on: macos-15
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.2
- uses: actions/checkout@v4.1.0
with:
path: hermes
- name: Install CMake
uses: ./hermes/.github/actions/install-cmake
- name: Setup dependencies
run: |-
brew install ninja
# Check out test262 at a pinned revision to reduce flakiness
git clone https://github.com/tc39/test262
cd test262
git checkout 62626e083bd506124aac6c799464d76c2c42851b
- name: Run Hermes tests and test262 with Intl
run: |-
cmake -S hermes -B build -GNinja -DHERMES_ENABLE_INTL=ON -DCMAKE_BUILD_TYPE=Release
cmake --build ./build
cmake --build ./build --target check-hermes
python3 hermes/utils/testsuite/run_testsuite.py --test-intl test262/test -b build/bin
test-linux-test262:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4.1.0
with:
path: hermes
- name: Setup dependencies
run: |-
sudo apt update
sudo apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev zip python3
# Check out test262 at a pinned revision to reduce flakiness
git clone https://github.com/tc39/test262
cd test262
git checkout 62626e083bd506124aac6c799464d76c2c42851b
- name: Run test262 with Intl
run: |-
cmake -S hermes -B build -DHERMES_ENABLE_INTL=ON -DCMAKE_CXX_FLAGS=-O2 -DCMAKE_C_FLAGS=-O2 -DCMAKE_BUILD_TYPE=Release
cmake --build ./build -j 4
# Not running Hermes test until more of Intl is built out:
# toLocaleLowerCase and toLocaleUpperCase are the two main ones.
# cmake --build ./build --target check-hermes -j 4
python3 hermes/utils/testsuite/run_testsuite.py --test-intl test262/test -b build/bin
sandbox:
runs-on: ubuntu-22.04
container:
image: emscripten/emsdk:3.1.39
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install dependencies
run: |-
apt update
apt install -y libicu-dev tzdata
wget https://github.com/WebAssembly/wabt/releases/download/1.0.33/wabt-1.0.33-ubuntu.tar.gz
tar -xvf ./wabt-1.0.33-ubuntu.tar.gz
- uses: actions/checkout@v4.1.0
with:
path: hermes
- name: Build Hermes with Emscripten
run: |-
# Generate the host compiler.
cmake -S hermes -B build_host -DCMAKE_BUILD_TYPE=Release
cmake --build ./build_host --target hermesc -j 4
# Generate and build the debug artefact.
cmake -S hermes -B build_wasm_dbg \
-DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DIMPORT_HOST_COMPILERS=build_host/ImportHostCompilers.cmake \
-DCMAKE_BUILD_TYPE=Debug -DHERMES_UNICODE_LITE=ON \
-DCMAKE_CXX_FLAGS=-O2 -DCMAKE_C_FLAGS=-O2 \
-DCMAKE_EXE_LINKER_FLAGS="-sALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=256KB" \
-DHERMES_ENABLE_DEBUGGER=OFF -DHERMES_SLOW_DEBUG=OFF
cmake --build build_wasm_dbg --target hermesSandboxImpl -j 4
./wabt-1.0.33/bin/wasm2c build_wasm_dbg/API/hermes_sandbox/hermesSandboxImpl.wasm -n hermes \
-o hermes/API/hermes_sandbox/external/hermes_sandbox_impl_dbg_compiled.c --num-outputs 8
# Generate and build the release artefact.
cmake -S hermes -B build_wasm_opt \
-DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
-DIMPORT_HOST_COMPILERS=build_host/ImportHostCompilers.cmake \
-DCMAKE_BUILD_TYPE=Release -DHERMES_UNICODE_LITE=ON \
-DCMAKE_EXE_LINKER_FLAGS="-sALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=256KB -g2" \
-DHERMES_ENABLE_DEBUGGER=OFF
cmake --build build_wasm_opt --target hermesSandboxImpl -j 4
./wabt-1.0.33/bin/wasm2c build_wasm_opt/API/hermes_sandbox/hermesSandboxImpl.wasm -n hermes \
-o hermes/API/hermes_sandbox/external/hermes_sandbox_impl_opt_compiled.c --num-outputs 8
- name: Build and test with the newly generated sandbox
run: |-
cmake -S hermes -B build_dbg -DCMAKE_BUILD_TYPE=Debug
cmake --build build_dbg -j 4
cmake --build build_dbg --target check-hermes -j 4
cmake -S hermes -B build_opt -DCMAKE_BUILD_TYPE=Release
cmake --build build_opt -j 4
cmake --build build_opt --target check-hermes -j 4
95 changes: 95 additions & 0 deletions .github/workflows/test-apple-runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: test-apple-runtime

on:
workflow_call

jobs:
test-apple-runtime:
runs-on: macos-15
env:
TERM: dumb
HERMES_WS_DIR: "/tmp/hermes"
HOMEBREW_NO_AUTO_UPDATE: 1
strategy:
fail-fast: false
matrix:
include:
- destination: platform=macOS
scheme: ApplePlatformsIntegrationMacTests
name: Test MacOS application
- destination: platform=iOS Simulator,name=iPhone 16
scheme: ApplePlatformsIntegrationMobileTests
name: Test iPhone application
- destination: platform=visionOS Simulator,OS=2.5,name=Apple Vision Pro
scheme: ApplePlatformsIntegrationVisionOSTests
name: Test Apple Vision application
- destination: platform=tvOS Simulator,name=Apple TV
scheme: ApplePlatformsIntegrationTVOSTests
name: Test Apple TV application
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup xcode
uses: ./.github/actions/setup-xcode
- name: Install CMake
uses: ./.github/actions/install-cmake
- name: Install dependencies
shell: bash
run: brew install ninja
# =============================== #
# Download visionOS SDK if Needed #
# =============================== #
- name: Download visionOS SDK
id: download-visionos-sdk
shell: bash
if: ${{ matrix.scheme == 'ApplePlatformsIntegrationVisionOSTests' }}
continue-on-error: true
run: xcodebuild -downloadPlatform visionOS

# The download is flaky. Sometimes it fails to connect. So we wait 5 sec and retry once.
- name: Try again to download visionOS SDK
if: ${{ matrix.scheme == 'ApplePlatformsIntegrationVisionOSTests' && steps.download-visionos-sdk.outcome == 'failure' }}
shell: bash
run: |
sleep 5
xcodebuild -downloadPlatform visionOS
# =========================== #
# Download tvOS SDK if Needed #
# =========================== #
- name: Download tvOS SDK
id: download-tvos-sdk
shell: bash
if: ${{ matrix.scheme == 'ApplePlatformsIntegrationTVOSTests' }}
continue-on-error: true
run: xcodebuild -downloadPlatform tvOS
# The download is flaky. Sometimes it fails to connect. So we wait 5 sec and retry once.
- name: Try again to download visionOS SDK
if: ${{ matrix.scheme == 'ApplePlatformsIntegrationTVOSTests' && steps.download-tvos-sdk.outcome == 'failure' }}
shell: bash
run: |
sleep 5
xcodebuild -downloadPlatform tvOS

- name: Use built artifacts
uses: actions/download-artifact@v4
with:
path: .
name: hermes-darwin-bin-Debug
- name: Unzip artifacts
shell: bash
run: |
ls -l .
tar -xzv -f hermes-ios-Debug.tar.gz
- name: Run pod install on ApplePlatformsIntegrationTestApp
shell: bash
run: pod install
working-directory: test/ApplePlatformsIntegrationTestApp
- name: ${{ matrix.name }}
shell: bash
run: |-
xcodebuild test \
-workspace ApplePlatformsIntegrationTests.xcworkspace \
-configuration Debug \
-destination '${{ matrix.destination }}' \
-scheme ${{ matrix.scheme }}
working-directory: test/ApplePlatformsIntegrationTestApp
8 changes: 7 additions & 1 deletion test/ApplePlatformsIntegrationTestApp/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ source 'https://cdn.cocoapods.org/'

target 'ApplePlatformsIntegrationMobileTests' do
use_frameworks!
platform :ios, '11'
platform :ios, '12.0'
pod 'hermes-engine', :path => '../../'
end

target 'ApplePlatformsIntegrationVisionOSTests' do
use_frameworks!
platform :visionos, '1.0'
pod 'hermes-engine', :path => '../../'
end

Expand Down
Loading