Skip to content

Commit

Permalink
Hermes: Use pre-built Hermes runtime in iOS Template tests (#33974)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #33974

Enable Hermes in iOS Template tests and use pre-built Hermes binaries from Circle CI.

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D36989241

fbshipit-source-id: a240713d0bd0383fa218f8fc031e81467ebeb376
  • Loading branch information
hramos authored and facebook-github-bot committed Jun 9, 2022
1 parent 6154cb7 commit d592bdc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,24 @@ jobs:
executor: reactnativeios
environment:
- PROJECT_NAME: "iOSTemplateProject"
- HERMES_WS_DIR: *hermes_workspace_root

steps:
- checkout_code_with_cache
- run_yarn
- attach_workspace:
at: .

- *attach_hermes_workspace
- run:
name: Set USE_HERMES=1
command: echo "export USE_HERMES=1" >> $BASH_ENV
- run:
name: Set HERMES_ENGINE_TARBALL_PATH
command: |
echo "export HERMES_ENGINE_TARBALL_PATH=$(ls -AU $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-*.tar.gz | head -1)" >> $BASH_ENV
- run:
name: Set RCT_VERBOSE_POD_INSTALL=1
command: echo "export RCT_VERBOSE_POD_INSTALL=1" >> $BASH_ENV
- run:
name: Create iOS template project
command: |
Expand All @@ -693,8 +704,7 @@ jobs:
node ./scripts/set-rn-template-version.js "file:$PATH_TO_PACKAGE"
mkdir -p ~/tmp
cd ~/tmp
node "$REPO_ROOT/cli.js" init "$PROJECT_NAME" --template "$REPO_ROOT"
node "$REPO_ROOT/cli.js" init "$PROJECT_NAME" --template "$REPO_ROOT" --verbose
- run:
name: Build template project
command: |
Expand Down Expand Up @@ -992,6 +1002,9 @@ jobs:
cp LICENSE /tmp/cocoapods-package-root
tar -C /tmp/cocoapods-package-root/ -czvf /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz .
mkdir -p /tmp/hermes/hermes-runtime-darwin
cp /tmp/hermes/output/hermes-runtime-darwin-v$(get_release_version).tar.gz /tmp/hermes/hermes-runtime-darwin/.
- save_cache:
key: *hermes_cache_key
paths:
Expand All @@ -1002,12 +1015,13 @@ jobs:
- ~/react-native/hermes/build_macosx
- ~/react-native/hermes/destroot
- store_artifacts:
path: /tmp/hermes/output/
path: /tmp/hermes/hermes-runtime-darwin/
- store_artifacts:
path: /tmp/hermes/osx-bin/
- persist_to_workspace:
root: /tmp/hermes/
paths:
- hermes-runtime-darwin
- osx-bin

build_hermesc_windows:
Expand Down
4 changes: 4 additions & 0 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ def get_default_flags()
flags[:hermes_enabled] = true
end

if ENV['USE_HERMES'] == '1'
flags[:hermes_enabled] = true
end

return flags
end

Expand Down

0 comments on commit d592bdc

Please sign in to comment.