Skip to content

Commit

Permalink
[LOCAL] fix: use REACT_NATIVE_CI instead of CI envvar (#35605)
Browse files Browse the repository at this point in the history
* [LOCAL] fix: use META_CI instead of CI envvar

* META_CI -> REACT_NATIVE_CI

* Rename more occurences of CI to REACT_NATIVE_CI

* Use REACT_NATIVE_CI in rn-tester/Podfile

* Add REACT_NATIVE_CI to prepare_hermes_workspace

* revert: Use REACT_NATIVE_CI in rn-tester/Podfile

* Consume hermes-engine.podspec from sdks/hermes-engine

* Consume hermes-engine.podspec from sdks/hermes-engine. Update tests
  • Loading branch information
Dmytro Rykun authored Dec 12, 2022
1 parent 0edcbc3 commit ed16fdb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ executors:
macos:
xcode: *xcode_version
resource_class: macos.x86.medium.gen2
environment:
- REACT_NATIVE_CI: true

# -------------------------
# COMMANDS
Expand Down Expand Up @@ -266,7 +268,7 @@ commands:
echo "$VERSION" > /tmp/react-native-version
echo "React Native Version is $(cat /tmp/react-native-version)"
echo "Hermes commit is $(cat /tmp/hermes/hermesversion)"
with_hermes_tarball_cache_span:
parameters:
steps:
Expand Down Expand Up @@ -1127,6 +1129,7 @@ jobs:
environment:
- HERMES_WS_DIR: *hermes_workspace_root
- HERMES_VERSION_FILE: "sdks/.hermesversion"
- REACT_NATIVE_CI: true
steps:
- run:
name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions scripts/cocoapods/__tests__/jsengine-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def teardown
Pod::UI.reset()
podSpy_cleanUp()
ENV['USE_HERMES'] = '1'
ENV['CI'] = nil
ENV['REACT_NATIVE_CI'] = nil
File.reset()
end

Expand Down Expand Up @@ -107,7 +107,7 @@ def test_setupHermes_whenHermesScriptSucceeds_installsPods
assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi")
assert_equal($podInvocation["React-hermes"][:path], "../../ReactCommon/hermes")
assert_equal($podInvocation["libevent"][:version], "~> 2.1.12")
assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes/hermes-engine.podspec")
assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes-engine/hermes-engine.podspec")
end

def test_setupHermes_installsPods_installsFabricSubspecWhenFabricEnabled
Expand All @@ -120,7 +120,7 @@ def test_setupHermes_installsPods_installsFabricSubspecWhenFabricEnabled
# Assert
assert_equal($podInvocationCount, 4)
assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi")
assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes/hermes-engine.podspec")
assert_equal($podInvocation["hermes-engine"][:podspec], "../../sdks/hermes-engine/hermes-engine.podspec")
assert_equal($podInvocation["React-hermes"][:path], "../../ReactCommon/hermes")
assert_equal($podInvocation["libevent"][:version], "~> 2.1.12")
end
Expand All @@ -133,7 +133,7 @@ def test_isBuildingHermesFromSource_whenTarballIsNilAndVersionIsNotNightly_retur
end

def test_isBuildingHermesFromSource_whenTarballIsNilAndInReleaseBranch_returnTrue
ENV['CI'] = 'true'
ENV['REACT_NATIVE_CI'] = 'true'
File.mocked_existing_files(['../../sdks/.hermesversion'])
assert_true(is_building_hermes_from_source("0.999.0", '../..'))
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/cocoapods/jsengine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def setup_hermes!(react_native_path: "../node_modules/react-native", fabric_enab
abort unless prep_status == 0

pod 'React-jsi', :path => "#{react_native_path}/ReactCommon/jsi"
pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes/hermes-engine.podspec"
pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes-engine/hermes-engine.podspec"
pod 'React-hermes', :path => "#{react_native_path}/ReactCommon/hermes"
pod 'libevent', '~> 2.1.12'
end
Expand Down Expand Up @@ -72,7 +72,7 @@ def is_building_hermes_from_source(react_native_version, react_native_path)
isInMain = react_native_version.include?('1000.0.0')

hermestag_file = File.join(react_native_path, "sdks", ".hermesversion")
isInCI = ENV['CI'] === 'true'
isInCI = ENV['REACT_NATIVE_CI'] === 'true'

isReleaseBranch = File.exist?(hermestag_file) && isInCI

Expand Down
2 changes: 1 addition & 1 deletion scripts/hermes/prepare-hermes-for-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function main(isInCI) {
}
}

const isInCI = process.env.CI === 'true';
const isInCI = process.env.REACT_NATIVE_CI === 'true';

main(isInCI).then(() => {
process.exit(0);
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-e2e-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ if (argv.target === 'RNTester') {
exec(
`cd packages/rn-tester && USE_HERMES=${
argv.hermes ? 1 : 0
} CI=${onReleaseBranch} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`,
} REACT_NATIVE_CI=${onReleaseBranch} RCT_NEW_ARCH_ENABLED=1 bundle exec pod install --ansi`,
);

// if everything succeeded so far, we can launch Metro and the app
Expand Down
2 changes: 1 addition & 1 deletion sdks/hermes-engine/hermes-engine.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ version = package['version']

# sdks/.hermesversion
hermestag_file = File.join(react_native_path, "sdks", ".hermesversion")
isInCI = ENV['CI'] === 'true'
isInCI = ENV['REACT_NATIVE_CI'] === 'true'

source = {}
git = "https://github.com/facebook/hermes.git"
Expand Down

0 comments on commit ed16fdb

Please sign in to comment.