2019-05-31 01:07:45 +03:00
version : 2.1
2019-02-24 04:01:34 +03:00
2020-03-30 17:19:23 +03:00
# -------------------------
# ORBS
# -------------------------
orbs :
win : circleci/windows@2.4.0
2019-02-24 04:01:34 +03:00
# -------------------------
2022-03-08 04:02:08 +03:00
# REFERENCES
2019-02-24 04:01:34 +03:00
# -------------------------
2022-03-08 04:02:08 +03:00
references :
defaults : &defaults
working_directory : ~/react-native
environment :
- GIT_COMMIT_DESC : git log --format=oneline -n 1 $CIRCLE_SHA1
# The public github tokens are publicly visible by design
- PUBLIC_PULLBOT_GITHUB_TOKEN_A : &github_pullbot_token_a "a6edf8e8d40ce4e8b11a"
- PUBLIC_PULLBOT_GITHUB_TOKEN_B : &github_pullbot_token_b "150e1341f4dd9c944d2a"
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A : &github_analysisbot_token_a "312d354b5c36f082cfe9"
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B : &github_analysisbot_token_b "07973d757026bdd9f196"
# Homebrew currently breaks while updating:
# https://discuss.circleci.com/t/brew-install-fails-while-updating/32992
- HOMEBREW_NO_AUTO_UPDATE : 1
hermes_workspace_root : &hermes_workspace_root
/tmp/hermes
2022-10-07 20:21:25 +03:00
hermes_tarball_artifacts_dir : &hermes_tarball_artifacts_dir
/tmp/hermes/hermes-runtime-darwin
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
hermes_osxbin_artifacts_dir : &hermes_osxbin_artifacts_dir
/tmp/hermes/osx-bin
2022-03-08 04:02:08 +03:00
attach_hermes_workspace : &attach_hermes_workspace
attach_workspace :
at : *hermes_workspace_root
2022-12-14 13:17:16 +03:00
main_only : &main_only
filters :
branches :
only : main
main_or_stable_only : &main_or_stable_only
filters :
branches :
only :
- main
- /0\.[0-9]+[\.[0-9]+]?-stable/
2022-05-25 21:44:42 +03:00
# -------------------------
# Dependency Anchors
# -------------------------
dependency_versions :
2022-10-12 04:27:25 +03:00
xcode_version : &xcode_version "14.0.1"
2022-11-25 17:44:21 +03:00
nodelts_image : &nodelts_image "cimg/node:18.12.1"
nodeprevlts_image : &nodeprevlts_image "cimg/node:16.18.1"
2022-05-25 21:44:42 +03:00
2022-05-12 21:08:29 +03:00
# -------------------------
# Cache Key Anchors
# -------------------------
# Anchors for the cache keys
cache_keys :
2022-05-18 17:43:51 +03:00
checkout_cache_key : &checkout_cache_key v1-checkout
2022-05-12 21:08:29 +03:00
gems_cache_key : &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
gradle_cache_key : &gradle_cache_key v1-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "ReactAndroid/gradle.properties" }}
2022-09-22 23:41:51 +03:00
hermes_workspace_cache_key : &hermes_workspace_cache_key v4-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
2022-12-13 15:19:43 +03:00
hermes_workspace_debug_cache_key : &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_workspace_release_cache_key : &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
2022-08-24 15:16:33 +03:00
hermes_windows_cache_key : &hermes_windows_cache_key v3-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
2022-12-13 15:19:43 +03:00
hermes_tarball_debug_cache_key : &hermes_tarball_debug_cache_key v4-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
hermes_tarball_release_cache_key : &hermes_tarball_release_cache_key v3-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
2022-08-24 15:16:33 +03:00
pods_cache_key : &pods_cache_key v8-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
2022-05-12 21:08:29 +03:00
windows_yarn_cache_key : &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
2022-12-02 18:32:30 +03:00
windows_choco_cache_key : &windows_choco_cache_key v1-win-choco-cache-{{ .Environment.CIRCLE_JOB }}
2022-05-12 21:08:29 +03:00
yarn_cache_key : &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
2022-09-22 23:41:51 +03:00
cache_paths :
hermes_workspace_macos_cache_paths : &hermes_workspace_macos_cache_paths
- ~/react-native/sdks/hermes/build_macosx
- ~/react-native/sdks/hermes/destroot
hermes_tarball_cache_paths : &hermes_tarball_cache_paths
2022-10-07 20:21:25 +03:00
- *hermes_tarball_artifacts_dir
2022-09-22 23:41:51 +03:00
2022-03-08 04:02:08 +03:00
# -------------------------
# Filters
# -------------------------
# CircleCI filters are OR-ed, with all branches triggering by default and tags excluded by default
# CircleCI env-vars are only set with the branch OR tag that triggered the job, not both.
# In this case, CIRCLE_BRANCH is unset, but CIRCLE_TAG is set.
only_release_tags : &only_release_tags
# Both of the following conditions must be included!
# Ignore any commit on any branch by default.
branches :
ignore : /.*/
# Only act on version tags.
tags :
only : /v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/
2017-09-21 23:34:02 +03:00
2019-05-31 01:07:45 +03:00
# -------------------------
# EXECUTORS
# -------------------------
executors :
2020-02-14 10:11:41 +03:00
nodelts :
2019-05-31 01:07:45 +03:00
<< : *defaults
docker :
2021-06-04 17:18:34 +03:00
# Note: Version set separately for Windows builds, see below.
2022-05-25 21:44:42 +03:00
- image : *nodelts_image
2022-04-02 02:19:29 +03:00
resource_class : "xlarge"
2020-02-14 10:11:41 +03:00
nodeprevlts :
2019-05-31 01:07:45 +03:00
<< : *defaults
docker :
2022-05-25 21:44:42 +03:00
- image : *nodeprevlts_image
2022-04-02 02:19:29 +03:00
resource_class : "xlarge"
2019-05-31 01:07:45 +03:00
reactnativeandroid :
<< : *defaults
docker :
2023-01-18 20:49:27 +03:00
- image : reactnativecommunity/react-native-android:6.2
2022-04-02 02:19:29 +03:00
resource_class : "xlarge"
2019-05-31 01:07:45 +03:00
environment :
- TERM : "dumb"
- ADB_INSTALL_TIMEOUT : 10
- GRADLE_OPTS : '-Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError"'
- BUILD_THREADS : 2
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
# Repeated here, as the environment key in this executor will overwrite the one in defaults
2020-12-07 14:10:46 +03:00
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A : *github_analysisbot_token_a
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B : *github_analysisbot_token_b
- PUBLIC_PULLBOT_GITHUB_TOKEN_A : *github_pullbot_token_a
- PUBLIC_PULLBOT_GITHUB_TOKEN_B : *github_pullbot_token_b
2019-05-31 01:07:45 +03:00
reactnativeios :
<< : *defaults
macos :
2022-05-25 21:44:42 +03:00
xcode : *xcode_version
2022-04-02 02:19:29 +03:00
resource_class : macos.x86.medium.gen2
2023-01-05 17:58:38 +03:00
environment :
- BUILD_FROM_SOURCE : true
2019-05-31 01:07:45 +03:00
# -------------------------
# COMMANDS
# -------------------------
commands :
2022-05-18 17:43:51 +03:00
# Checkout with cache, on machines that are using Docker the cache is ignored
checkout_code_with_cache :
parameters :
checkout_base_cache_key :
default : *checkout_cache_key
type : string
steps :
- restore_cache :
fix: Change checkout cache strategy (#35259)
Summary:
This PR updates he cache strategy for the `checkout_with_cache command`.
The previous strategy was using three keys in descending priority order to restore from the cache:
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}`
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}`
*`<< parameters.checkout_base_cache_key >>-{{ arch }}`
When it saves, it always saves using the first key.
The restore works as it follows:
1. It tries to restore the cache using the first key
2. If it fails, it checks whether there is a cache hit for a key that matches the second key as a pattern
3. If it fails, it checks whether there is a cache hit for a key that matches the third pattern
4. Otherwise, it is a cache miss.
This does not work well. Imagine that you submit some code in commit `xxxx` for branch `abc`.
The CI run the first time, it misses all the three keys and checks out the code normally.
Then, it stores the checked out code in the `checkout_key-abc-xxxx` key.
Then, you submit a commit `yyyy` in the same branch.
The CI starts, it tries with the key `checkout_key-abc-yyyy` but it misses
It tries with the key `checkout_key-abc` and it finds the cache for `checkout_key-abc-xxxx` and it restores it, forgetting about your changes.
While doing the release, we created a tag in a commit X. Then we manually had to remove it, but the CI had a cached version of .git with the tag for
the `0.71-stable` branch. And the release failed because the tag was already existing.
### Why this should work
With this solution, we are going to cache using the commit. If there is no cache for a specific commit, it will be a miss. It won't try to be smart and
retrieve the code from previous caches.
This should prevent stale caches and if we manually remove a tag, and then we do a new commit, it should work.
This is a good trade-off that allows to pay the checkout cost only for the first batch of jobs of the pipeline.
**NOTE:** This still won't work if we don't do a new commit.
## Changelog
[General] [Fixed] - Change Cache strategy to avoid cache bumps in Release
Pull Request resolved: https://github.com/facebook/react-native/pull/35259
Test Plan: 1. CircleCI must be green
Reviewed By: jacdebug
Differential Revision: D41120895
Pulled By: cipolleschi
fbshipit-source-id: 2b45da01803197dbe4a25a313a9dfc53a976d096
2022-11-08 17:50:25 +03:00
key : << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
2022-08-23 16:43:01 +03:00
- checkout
2022-05-18 17:43:51 +03:00
- save_cache :
2022-10-07 20:21:25 +03:00
key : << parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}
2022-05-18 17:43:51 +03:00
paths :
- ".git"
2019-05-31 01:07:45 +03:00
setup_artifacts :
steps :
- run :
name : Initial Setup
2019-12-20 03:53:54 +03:00
command : mkdir -p ./reports/{buck,build,junit,outputs}
2019-05-31 01:07:45 +03:00
2021-10-02 07:21:03 +03:00
setup_ruby :
steps :
- restore_cache :
2022-05-12 21:08:29 +03:00
key : *gems_cache_key
2022-04-12 17:59:52 +03:00
- run :
name : Bundle Install
command : |
source /usr/local/share/chruby/auto.sh
bundle check || bundle install --path vendor/bundle --clean
2021-10-02 07:21:03 +03:00
- save_cache :
2022-05-12 21:08:29 +03:00
key : *gems_cache_key
2021-10-02 07:21:03 +03:00
paths :
- vendor/bundle
2019-05-31 01:07:45 +03:00
run_yarn :
2022-05-12 21:08:29 +03:00
parameters :
yarn_base_cache_key :
default : *yarn_cache_key
type : string
2019-05-31 01:07:45 +03:00
steps :
- restore_cache :
keys :
2022-05-12 21:08:29 +03:00
- << parameters.yarn_base_cache_key >>-{{ arch }}-{{ checksum "yarn.lock" }}
- << parameters.yarn_base_cache_key >>-{{ arch }}
- << parameters.yarn_base_cache_key >>
2019-05-31 01:07:45 +03:00
- run :
2020-04-01 03:36:31 +03:00
name : "Yarn: Install Dependencies"
2019-05-31 01:07:45 +03:00
command : |
# Skip yarn install on metro bump commits as the package is not yet
# available on npm
if [[ $(echo "$GIT_COMMIT_DESC" | grep -c "Bump metro@") -eq 0 ]]; then
yarn install --non-interactive --cache-folder ~/.cache/yarn
fi
- save_cache :
paths :
- ~/.cache/yarn
2022-05-12 21:08:29 +03:00
key : << parameters.yarn_base_cache_key >>-{{ arch }}-{{ checksum "yarn.lock" }}
2019-05-31 01:07:45 +03:00
brew_install :
parameters :
package :
description : Homebrew package to install
type : string
steps :
2020-07-10 17:13:17 +03:00
- run :
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
name : "Brew: Install << parameters.package >>"
2022-03-08 04:02:08 +03:00
command : brew install << parameters.package >> >/dev/null
2019-05-31 01:07:45 +03:00
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
with_rntester_pods_cache_span :
2019-06-29 05:12:42 +03:00
parameters :
steps :
type : steps
steps :
2019-07-25 21:42:49 +03:00
- run :
name : Setup CocoaPods cache
2020-08-20 03:54:30 +03:00
# Copy packages/rn-tester/Podfile.lock since it can be changed by pod install
command : cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak
2019-06-29 05:12:42 +03:00
- restore_cache :
keys :
2022-04-02 10:02:11 +03:00
# The committed lockfile is generated using USE_FRAMEWORKS=0 and USE_HERMES=1 so it could load an outdated cache if a change
2020-12-04 11:23:38 +03:00
# only affects the frameworks or hermes config. To help prevent this also cache based on the content of Podfile.
2022-05-12 21:08:29 +03:00
- *pods_cache_key
2019-06-29 05:12:42 +03:00
- steps : << parameters.steps >>
- save_cache :
paths :
2020-08-20 03:54:30 +03:00
- packages/rn-tester/Pods
2022-05-12 21:08:29 +03:00
key : *pods_cache_key
2019-06-29 05:12:42 +03:00
2019-05-31 01:07:45 +03:00
download_gradle_dependencies :
steps :
- restore_cache :
keys :
2022-05-12 21:08:29 +03:00
- *gradle_cache_key
2019-05-31 01:07:45 +03:00
- run :
name : Download Dependencies Using Gradle
2022-05-18 01:31:48 +03:00
command : ./gradlew downloadAll
2019-05-31 01:07:45 +03:00
- save_cache :
paths :
- ~/.gradle
- ReactAndroid/build/downloads
- ReactAndroid/build/third-party-ndk
2022-05-12 21:08:29 +03:00
key : *gradle_cache_key
2019-05-31 01:07:45 +03:00
2020-04-01 03:36:31 +03:00
run_e2e :
parameters :
platform :
description : Target platform
type : enum
enum : [ "android" , "ios" , "js" ]
default : "js"
retries :
description : How many times the job should try to run these tests
type : integer
default : 3
steps :
- run :
name : "Run Tests: << parameters.platform >> End-to-End Tests"
command : node ./scripts/run-ci-e2e-tests.js --<< parameters.platform >> --retries << parameters.retries >>
report_bundle_size :
parameters :
platform :
description : Target platform
type : enum
enum : [ "android" , "ios" ]
steps :
- run :
name : Report size of RNTester.app (analysis-bot)
2021-11-03 22:09:13 +03:00
command : GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" scripts/circleci/report-bundle-size.sh << parameters.platform >> || true
2020-04-01 03:36:31 +03:00
2022-12-13 15:19:43 +03:00
get_react_native_version :
steps :
- run :
name : Get React Native version
command : |
VERSION=$( grep '"version"' package.json | cut -d '"' -f 4 | head -1)
# Save the react native version we are building in a file so we can use that file as part of the cache key.
echo "$VERSION" > /tmp/react-native-version
echo "React Native Version is $(cat /tmp/react-native-version)"
echo "Hermes commit is $(cat /tmp/hermes/hermesversion)"
2022-07-20 19:12:47 +03:00
with_hermes_tarball_cache_span :
2022-05-13 22:51:09 +03:00
parameters :
steps :
type : steps
2022-07-20 19:12:47 +03:00
set_tarball_path :
type : boolean
2022-08-23 16:43:01 +03:00
default : False
2022-09-22 23:41:51 +03:00
flavor :
default : "Debug"
2022-10-19 00:25:38 +03:00
description : The Hermes build type. Must be one of "Debug", "Release".
type : enum
enum : [ "Debug" , "Release" ]
2022-10-07 20:21:25 +03:00
hermes_tarball_artifacts_dir :
type : string
default : *hermes_tarball_artifacts_dir
2022-05-13 22:51:09 +03:00
steps :
2022-12-13 15:19:43 +03:00
- get_react_native_version
2022-09-22 23:41:51 +03:00
- when :
condition :
equal : [ << parameters.flavor >>, "Debug"]
steps :
- restore_cache :
keys :
- *hermes_tarball_debug_cache_key
- when :
condition :
equal : [ << parameters.flavor >>, "Release"]
steps :
- restore_cache :
keys :
- *hermes_tarball_release_cache_key
2022-07-20 19:12:47 +03:00
- when :
condition : << parameters.set_tarball_path >>
steps :
- run :
2022-10-07 20:21:25 +03:00
name : Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
2022-07-20 19:12:47 +03:00
command : |
2022-10-07 20:21:25 +03:00
HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
Reduce flakiness of CI (#34235)
Summary:
How the Hermes cache worked had a concurrency issue. It used to work by asking the Hermes repository for the latest commit and using that commit as cache key to try and retrieve a built version of Hermes to avoid to compile it more than once.
The problem happened when the `build_hermes_macos` was building Hermes using a commit A.
While building, another PR could be merged into `hermes:main`, creating commit B.
When this happened, the tasks `test_ios` and `test_ios_rntester`would try to retrieve a cached version of Hermes using commit B. That version did not exist because Hermes was created using commit A, and the job would either fail or trying to build Hermes from source, ending up taking a lot of time.
This PR attaches the `.hermes-cache-key-file` to the workspace and restores it in the other jobs, making sure that the same cache key is used in all three jobs.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[General] [Changed] - Attach the `.hermes-cache-key-file` to the workspace to avoid race conditions for new PR landing on Hermes and changing the head commit between the time Hermes is built and the time it has to be consumed.
Pull Request resolved: https://github.com/facebook/react-native/pull/34235
Test Plan:
Tested manually, looking at the messages in CI.
**build_hermes_macos**
<img width="881" alt="Screenshot 2022-07-21 at 15 40 02" src="https://user-images.githubusercontent.com/11162307/180241834-776f2291-63bb-4bb2-8837-14434b50fe61.png">
**test_ios_rntester**: notice that the `echo` is not executed, meaning that the `if` does not evaluate to true and, therefore, the file has been correctly attached.
<img width="956" alt="Screenshot 2022-07-21 at 15 40 52" src="https://user-images.githubusercontent.com/11162307/180242004-d9db0336-18d3-4321-a997-b538baa6beee.png">
**test_ios**: notice that the `echo` is not executed, meaning that the `if` does not evaluate to true and, therefore, the file has been correctly attached.
<img width="900" alt="Screenshot 2022-07-21 at 15 46 33" src="https://user-images.githubusercontent.com/11162307/180243359-79de5c7a-d2f0-4331-90c6-5bd2c0b5e1ac.png">
Reviewed By: cortinico
Differential Revision: D38037386
Pulled By: cipolleschi
fbshipit-source-id: 4db4f7c478e1afb2e4a18ba3d3f70896ed41d235
2022-07-22 15:56:02 +03:00
exit 0
2022-07-20 19:12:47 +03:00
fi
2022-10-07 20:21:25 +03:00
if [ ! -d ~/react-native ]; then
echo "No React Native checkout found. Run `checkout` first."
2022-09-22 23:41:51 +03:00
exit 0
fi
2022-10-07 20:21:25 +03:00
2022-11-14 19:31:30 +03:00
TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
2022-10-07 20:21:25 +03:00
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
echo "$TARBALL_PATH"
2022-07-20 19:12:47 +03:00
if [ ! -f $TARBALL_PATH ]; then
2022-10-07 20:21:25 +03:00
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
Reduce flakiness of CI (#34235)
Summary:
How the Hermes cache worked had a concurrency issue. It used to work by asking the Hermes repository for the latest commit and using that commit as cache key to try and retrieve a built version of Hermes to avoid to compile it more than once.
The problem happened when the `build_hermes_macos` was building Hermes using a commit A.
While building, another PR could be merged into `hermes:main`, creating commit B.
When this happened, the tasks `test_ios` and `test_ios_rntester`would try to retrieve a cached version of Hermes using commit B. That version did not exist because Hermes was created using commit A, and the job would either fail or trying to build Hermes from source, ending up taking a lot of time.
This PR attaches the `.hermes-cache-key-file` to the workspace and restores it in the other jobs, making sure that the same cache key is used in all three jobs.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[General] [Changed] - Attach the `.hermes-cache-key-file` to the workspace to avoid race conditions for new PR landing on Hermes and changing the head commit between the time Hermes is built and the time it has to be consumed.
Pull Request resolved: https://github.com/facebook/react-native/pull/34235
Test Plan:
Tested manually, looking at the messages in CI.
**build_hermes_macos**
<img width="881" alt="Screenshot 2022-07-21 at 15 40 02" src="https://user-images.githubusercontent.com/11162307/180241834-776f2291-63bb-4bb2-8837-14434b50fe61.png">
**test_ios_rntester**: notice that the `echo` is not executed, meaning that the `if` does not evaluate to true and, therefore, the file has been correctly attached.
<img width="956" alt="Screenshot 2022-07-21 at 15 40 52" src="https://user-images.githubusercontent.com/11162307/180242004-d9db0336-18d3-4321-a997-b538baa6beee.png">
**test_ios**: notice that the `echo` is not executed, meaning that the `if` does not evaluate to true and, therefore, the file has been correctly attached.
<img width="900" alt="Screenshot 2022-07-21 at 15 46 33" src="https://user-images.githubusercontent.com/11162307/180243359-79de5c7a-d2f0-4331-90c6-5bd2c0b5e1ac.png">
Reviewed By: cortinico
Differential Revision: D38037386
Pulled By: cipolleschi
fbshipit-source-id: 4db4f7c478e1afb2e4a18ba3d3f70896ed41d235
2022-07-22 15:56:02 +03:00
exit 0
2022-07-20 19:12:47 +03:00
fi
2022-09-22 23:41:51 +03:00
echo "Found Hermes tarball at $TARBALL_PATH"
2022-07-20 19:12:47 +03:00
echo "export HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $BASH_ENV
2022-12-13 15:19:43 +03:00
- run :
name : Print Hermes version
command : |
HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
if [[ -e $TARBALL_PATH ]]; then
tar -xf $TARBALL_PATH
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
./destroot/bin/hermes test.js
rm test.js
rm -rf destroot
else
echo 'No Hermes tarball found.'
fi
2022-05-13 22:51:09 +03:00
- steps : << parameters.steps >>
2022-09-22 23:41:51 +03:00
- when :
condition :
equal : [ << parameters.flavor >>, "Debug"]
steps :
- save_cache :
key : *hermes_tarball_debug_cache_key
paths : *hermes_tarball_cache_paths
- when :
condition :
equal : [ << parameters.flavor >>, "Release"]
steps :
- save_cache :
key : *hermes_tarball_release_cache_key
paths : *hermes_tarball_cache_paths
2022-05-13 22:51:09 +03:00
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
with_hermesc_span :
description : "Makes hermesc available to the provided steps, if hermesc is present."
parameters :
2022-10-19 00:25:38 +03:00
flavor :
default : "Debug"
description : The Hermes build type. Must be one of "Debug", "Release".
type : enum
enum : [ "Debug" , "Release" ]
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
steps :
type : steps
steps :
2022-10-19 00:25:38 +03:00
- export_hermesc :
flavor : << parameters.flavor >>
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
- steps : << parameters.steps >>
2022-10-19 00:25:38 +03:00
- export_hermesc :
flavor : << parameters.flavor >>
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
export_hermesc :
description : "Configures hermesc for use in Hermes builds when possible. The binary is built by either of the macOS or iOS builds, and may be cached by previous builds."
parameters :
2022-10-19 00:25:38 +03:00
flavor :
default : "Debug"
description : The Hermes build type. Must be one of "Debug", "Release".
type : enum
enum : [ "Debug" , "Release" ]
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
artifacts_dir :
type : string
default : *hermes_osxbin_artifacts_dir
steps :
- run :
2022-10-19 00:25:38 +03:00
name : "Export path to HermesC if available"
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
command : |
2022-10-19 00:25:38 +03:00
# Although the hermesc binary built by debug and release jobs is
# identical, we need to store it in distinct paths as Circle CI
# cannot have two different jobs write to the same path in
# artifacts.
mkdir -p << parameters.artifacts_dir >>/Debug << parameters.artifacts_dir >>/Release
hermesc_artifacts_path=<< parameters.artifacts_dir >>/<< parameters.flavor >>/hermesc
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
hermesc_bin_path=bin/hermesc
hermes_build_dir_macos=$(pwd)/sdks/hermes/build_macosx
hermes_build_dir_ios=$(pwd)/sdks/hermes/build_iphoneos
function export_hermesc_cmake_path {
build_dir=$1
hermesc_bin=$build_dir/$hermesc_bin_path
cmake_path=$build_dir/ImportHermesc.cmake
if [[ -f $cmake_path ]]; then
echo "export HERMES_OVERRIDE_HERMESC_PATH=$cmake_path" >> $BASH_ENV
fi
if [[ ! -f $hermesc_artifacts_path ]]; then
cp $hermesc_bin $hermesc_artifacts_path
fi
}
if [[ -f $hermes_build_dir_macos/$hermesc_bin_path ]]; then
export_hermesc_cmake_path $hermes_build_dir_macos
elif [[ -f $hermes_build_dir_ios/$hermesc_bin_path ]]; then
export_hermesc_cmake_path $hermes_build_dir_ios
fi
2019-02-24 04:01:34 +03:00
# -------------------------
# JOBS
# -------------------------
2017-09-21 23:34:02 +03:00
jobs :
2019-02-24 04:01:34 +03:00
# -------------------------
# JOBS: Analyze PR
# -------------------------
# Analyze pull request and raise any lint/flow issues.
# Issues will be posted to the PR itself via GitHub bots.
# This workflow should only fail if the bots fail to run.
analyze_pr :
2020-12-07 14:10:46 +03:00
executor : reactnativeandroid
2019-02-24 04:01:34 +03:00
steps :
2022-08-23 16:43:01 +03:00
- checkout
2019-05-31 01:07:45 +03:00
- run_yarn
2019-02-24 04:01:34 +03:00
2020-02-13 09:18:46 +03:00
2021-02-12 22:30:53 +03:00
# Note: The yarn gpg key needs to be refreshed to work around https://github.com/yarnpkg/yarn/issues/7866
2019-02-24 04:01:34 +03:00
- run :
2020-02-13 09:18:46 +03:00
name : Install additional GitHub bot dependencies
2021-10-02 03:00:23 +03:00
# TEMP: Added workaround from https://github.com/nodesource/distributions/issues/1266#issuecomment-932583579
2021-02-12 22:30:53 +03:00
command : |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
apt update && apt install -y shellcheck jq
2021-12-09 09:13:33 +03:00
apt-get -y install openssl ca-certificates
2021-10-02 03:00:23 +03:00
update-ca-certificates
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
apt update && apt install -y shellcheck jq
2019-02-24 04:01:34 +03:00
- run :
2019-05-22 05:35:40 +03:00
name : Run linters against modified files (analysis-bot)
command : GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" yarn lint-ci
2019-02-24 04:01:34 +03:00
when : always
# -------------------------
# JOBS: Analyze Code
# -------------------------
2019-05-31 01:07:45 +03:00
analyze_code :
2020-12-07 14:10:46 +03:00
executor : reactnativeandroid
2018-02-09 01:57:36 +03:00
steps :
2022-08-23 16:43:01 +03:00
- checkout
2019-05-31 01:07:45 +03:00
- setup_artifacts
- run_yarn
2018-02-09 01:57:36 +03:00
2019-02-24 04:01:34 +03:00
- run :
name : Lint code
2019-12-20 03:53:54 +03:00
command : scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
2019-04-12 19:50:13 +03:00
when : always
2019-02-24 04:01:34 +03:00
2020-12-07 14:10:46 +03:00
- run :
name : Lint Java
command : scripts/circleci/exec_swallow_error.sh yarn lint-java --check
when : always
2019-04-10 02:03:21 +03:00
- run :
2019-02-24 04:01:34 +03:00
name : Check for errors in code using Flow (iOS)
command : yarn flow-check-ios
when : always
2019-04-10 02:03:21 +03:00
- run :
2019-02-24 04:01:34 +03:00
name : Check for errors in code using Flow (Android)
command : yarn flow-check-android
when : always
2022-09-19 22:26:00 +03:00
- run :
name : Run TypeScript tests
command : yarn test-typescript
when : always
2019-02-24 04:01:34 +03:00
- run :
name : Sanity checks
command : |
./scripts/circleci/check_license.sh
./scripts/circleci/validate_yarn_lockfile.sh
when : always
2017-09-21 23:34:02 +03:00
2019-04-12 19:50:13 +03:00
- run :
name : Check formatting
command : yarn run format-check
when : always
2018-02-01 04:08:06 +03:00
- store_test_results :
2019-12-20 03:53:54 +03:00
path : ./reports/junit
2018-02-01 04:08:06 +03:00
2019-02-24 04:01:34 +03:00
# -------------------------
# JOBS: Test JavaScript
# -------------------------
2019-05-31 01:07:45 +03:00
test_js :
parameters :
executor :
type : executor
2020-02-14 10:11:41 +03:00
default : nodelts
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
run_disabled_tests :
type : boolean
default : false
2019-05-31 01:07:45 +03:00
executor : << parameters.executor >>
2017-09-21 23:34:02 +03:00
steps :
2022-08-23 16:43:01 +03:00
- checkout
2019-05-31 01:07:45 +03:00
- setup_artifacts
- run_yarn
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
- run :
name : Install rsync
2022-04-11 19:39:10 +03:00
command : sudo apt update && sudo apt install rsync
2019-02-24 04:01:34 +03:00
2020-04-01 03:36:31 +03:00
# -------------------------
# Run JavaScript tests
2019-04-12 19:50:13 +03:00
- run :
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
name : "Run Tests: JavaScript Tests"
2019-04-12 19:50:13 +03:00
command : node ./scripts/run-ci-javascript-tests.js --maxWorkers 2
2020-04-01 03:36:31 +03:00
- run_e2e :
platform : js
2019-02-24 04:01:34 +03:00
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
# Optionally, run disabled tests
- when :
condition : << parameters.run_disabled_tests >>
steps :
2020-04-01 03:36:31 +03:00
- run : echo "Failing tests may be moved here temporarily."
# -------------------------
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
2018-08-21 03:31:59 +03:00
- store_test_results :
2019-12-20 03:53:54 +03:00
path : ./reports/junit
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
2022-04-02 10:02:11 +03:00
# -------------------------
# JOBS: iOS Unit Tests
2019-02-24 04:01:34 +03:00
# -------------------------
2022-04-28 18:53:24 +03:00
test_ios :
2019-05-31 01:07:45 +03:00
executor : reactnativeios
2019-07-25 21:42:49 +03:00
parameters :
use_frameworks :
type : boolean
default : false
2020-04-01 03:36:31 +03:00
run_unit_tests :
description : Specifies whether unit tests should run.
type : boolean
default : false
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
run_disabled_tests :
2020-04-01 03:36:31 +03:00
description : Specifies whether disabled tests should run. Set this to true to debug failing tests.
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
type : boolean
default : false
2022-10-13 01:23:55 +03:00
jsengine :
default : "Hermes"
description : Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type : enum
enum : [ "Hermes" , "JSC" ]
2019-04-24 19:26:56 +03:00
environment :
2019-12-20 03:53:54 +03:00
- REPORTS_DIR : "./reports/junit"
2017-10-14 02:11:53 +03:00
steps :
2022-05-18 17:43:51 +03:00
- checkout_code_with_cache
2019-05-31 01:07:45 +03:00
- setup_artifacts
2021-10-02 07:21:03 +03:00
- setup_ruby
2022-05-03 17:11:54 +03:00
- run :
name : Run Ruby Tests
command : |
2022-05-11 20:00:28 +03:00
cd scripts
sh run_ruby_tests.sh
2019-05-31 01:07:45 +03:00
- run_yarn
2022-08-03 13:34:29 +03:00
- *attach_hermes_workspace
2019-06-29 05:12:42 +03:00
- run : |
2020-08-20 03:54:30 +03:00
cd packages/rn-tester
2019-06-29 05:12:42 +03:00
bundle check || bundle install
2019-02-24 04:01:34 +03:00
- run :
2019-06-29 05:12:42 +03:00
name : Boot iPhone Simulator
command : source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
2019-04-24 19:26:56 +03:00
- run :
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
name : Configure Environment Variables
2019-06-29 05:12:42 +03:00
command : |
2022-11-25 17:44:21 +03:00
echo 'export PATH=/usr/local/opt/node@18/bin:$PATH' >> $BASH_ENV
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
source $BASH_ENV
2019-04-24 19:26:56 +03:00
2022-05-13 20:51:41 +03:00
- run :
name : "Brew: Tap wix/brew"
command : brew tap wix/brew >/dev/null
- brew_install :
2022-10-13 01:23:55 +03:00
package : applesimutils watchman
2019-06-01 02:42:18 +03:00
2019-07-11 21:54:38 +03:00
- run :
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
name : Configure Watchman
2021-10-01 06:23:45 +03:00
command : echo "{}" > .watchmanconfig
2019-07-11 21:54:38 +03:00
2020-04-01 03:36:31 +03:00
- when :
condition : << parameters.use_frameworks >>
steps :
- run :
name : Set USE_FRAMEWORKS=1
command : echo "export USE_FRAMEWORKS=1" >> $BASH_ENV
2019-05-04 00:34:57 +03:00
2020-07-10 17:13:17 +03:00
- run :
2020-04-01 03:36:31 +03:00
name : Setup the CocoaPods environment
2021-10-02 07:21:03 +03:00
command : bundle exec pod setup
2020-04-01 03:36:31 +03:00
2022-07-20 19:12:47 +03:00
- with_hermes_tarball_cache_span :
2022-08-23 16:43:01 +03:00
set_tarball_path : True
2020-04-01 03:36:31 +03:00
steps :
2022-05-13 22:51:09 +03:00
- with_rntester_pods_cache_span :
steps :
- run :
name : Generate RNTesterPods Workspace
2022-10-13 01:23:55 +03:00
command : |
if [[ << parameters.jsengine >> == "JSC" ]]; then
export USE_HERMES=0
fi
cd packages/rn-tester && bundle exec pod install --verbose
2020-02-13 09:18:46 +03:00
2020-04-01 03:36:31 +03:00
# -------------------------
# Runs iOS unit tests
- when :
condition : << parameters.run_unit_tests >>
steps :
2020-07-10 17:13:17 +03:00
- run :
2020-04-01 03:36:31 +03:00
name : "Run Tests: iOS Unit and Integration Tests"
command : yarn test-ios
2022-08-03 13:34:29 +03:00
- run :
name : Zip Derived data folder
when : always
command : |
echo "zipping tests results"
cd /Users/distiller/Library/Developer/Xcode
XCRESULT_PATH=$(find . -name '*.xcresult')
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
- store_artifacts :
path : /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
2017-10-14 02:11:53 +03:00
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
# Optionally, run disabled tests
- when :
condition : << parameters.run_disabled_tests >>
steps :
2020-04-01 03:36:31 +03:00
- run : echo "Failing tests may be moved here temporarily."
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
- run :
name : "Run Tests: CocoaPods"
command : ./scripts/process-podspecs.sh
- run :
name : Free up port 8081 for iOS End-to-End Tests
command : |
# free up port 8081 for the packager before running tests
set +eo pipefail
lsof -i tcp:8081 | awk 'NR!=1 {print $2}' | xargs kill
set -eo pipefail
2020-04-01 03:36:31 +03:00
- run_e2e :
platform : ios
# -------------------------
2019-05-31 01:07:45 +03:00
2020-04-01 03:36:31 +03:00
# Collect Results
- report_bundle_size :
platform : ios
2019-05-31 01:07:45 +03:00
- store_test_results :
2019-12-20 03:53:54 +03:00
path : ./reports/junit
2019-05-31 01:07:45 +03:00
2022-08-11 12:46:00 +03:00
# -------------------------
# JOBS: Test Buck
# -------------------------
test_buck :
executor : reactnativeandroid
environment :
KOTLIN_HOME=third-party/kotlin
steps :
- checkout
- setup_artifacts
- run_yarn
- run :
name : Download Dependencies Using Buck
command : ./scripts/circleci/buck_fetch.sh
- run :
name : Build & Test React Native using Buck
command : |
buck build ReactAndroid/src/main/java/com/facebook/react
buck build ReactAndroid/src/main/java/com/facebook/react/shell
- run :
name : Run Tests - Android Unit Tests with Buck
command : buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS --xml ./reports/buck/all-results-raw.xml
- run :
name : Build JavaScript Bundle for instrumentation tests
command : node cli.js bundle --max-workers 2 --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
- run :
name : Build Tests - Android Instrumentation Tests with Buck
# Here, just build the instrumentation tests. There is a known issue with installing the APK to android-21+ emulator.
command : |
if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then
echo "JavaScript bundle missing, cannot run instrumentation tests. Verify Build JavaScript Bundle step completed successfully."; exit 1;
fi
2022-09-28 20:57:07 +03:00
source scripts/android-setup.sh && NO_BUCKD=1 scripts/retry3 timeout 300 buck build ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
2022-08-11 12:46:00 +03:00
- run :
name : Collect Test Results
command : |
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ./reports/build/ \;
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ./reports/outputs/ \;
find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} ./reports/buck/ \;
if [ -f ~/react-native/reports/buck/all-results-raw.xml ]; then
~/react-native/scripts/circleci/buckToJunit/buckToJunit.sh ~/react-native/reports/buck/all-results-raw.xml ~/react-native/reports/junit/results.xml
fi
when : always
- store_test_results :
path : ./reports/junit
2022-08-03 13:34:29 +03:00
2019-02-24 04:01:34 +03:00
# -------------------------
# JOBS: Test Android
# -------------------------
2018-02-09 01:57:36 +03:00
test_android :
2019-05-31 01:07:45 +03:00
executor : reactnativeandroid
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
parameters :
run_disabled_tests :
type : boolean
2020-07-10 17:13:17 +03:00
default : false
2017-09-21 23:34:02 +03:00
steps :
2022-08-23 16:43:01 +03:00
- checkout
2019-05-31 01:07:45 +03:00
- setup_artifacts
- run_yarn
- download_gradle_dependencies
2017-12-22 22:07:48 +03:00
2022-05-16 19:27:54 +03:00
- run :
name : Build & Test React Native using Gradle
command : ./gradlew buildAll
2022-08-11 12:46:00 +03:00
- report_bundle_size :
platform : android
2019-04-10 02:03:21 +03:00
2022-11-24 21:21:57 +03:00
- store_artifacts :
path : ~/react-native/packages/rn-tester/android/app/build/outputs/apk/
destination : rntester-apk
2020-04-01 03:36:31 +03:00
# Optionally, run disabled tests
✅ Green CI: Fix JavaScript e2e tests, disable failing Android e2e test (#28392)
Summary:
Jobs now have a `run_disabled_tests` argument that allows for the selective execution of disabled tests. When working on re-enabling a failing test, the contributor just needs to set `run_disabled_tests` to `true` in the appropriate workflow in `.circleci/config.yml`.
Tests can be kept green by moving failing tests into the disabled section until a contributor can provide a fix, thus ensuring signal is maintained on master. For example, a failing end-to-end test might be disabled in order to allow the signal from unit tests to be provided, as opposed to flat out failing the entire job.
What was done in this PR:
* The failing `test_js_e2e` job has been fixed, and merged into the `test_js` job. An empty disabled tests section is added for future use.
* The failing `test_ios_e2e` job has been merged into `test_ios`, with all of its steps gated behind the `run_disabled_steps` argument.
* The failing Android end-to-end tests have been added to `test_android`, gated behind the `run_disabled_steps` argument
* The failing Podspecs test has been added back into `test_ios`, gated behind the `run_disabled_steps` argument
## Changelog
[Internal] [CI] - ✅ Green CI, disabled test infrastructure work
Pull Request resolved: https://github.com/facebook/react-native/pull/28392
Test Plan: Verified on Circle CI
Reviewed By: cpojer
Differential Revision: D20665512
Pulled By: hramos
fbshipit-source-id: 831738027f90f4b23313893d8342d7e654f34726
2020-03-26 16:49:03 +03:00
- when :
condition : << parameters.run_disabled_tests >>
steps :
2020-04-01 03:36:31 +03:00
- run : echo "Failing tests may be moved here temporarily."
- run_e2e :
platform : android
2019-04-10 02:03:21 +03:00
2021-09-24 11:02:07 +03:00
# -------------------------
# JOBS: Test Android Template
# -------------------------
test_android_template :
executor : reactnativeandroid
2022-08-08 14:44:48 +03:00
parameters :
flavor :
default : "Debug"
2022-10-13 23:03:45 +03:00
description : The Android build type. Must be one of "Debug", "Release".
type : enum
enum : [ "Debug" , "Release" ]
2022-10-28 00:40:27 +03:00
architecture :
default : "OldArch"
description : Which React Native architecture to use. Must be one of "NewArch", "OldArch".
type : enum
enum : [ "NewArch" , "OldArch" ]
2022-09-12 22:33:07 +03:00
jsengine :
default : "Hermes"
2022-10-13 23:03:45 +03:00
description : Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type : enum
enum : [ "Hermes" , "JSC" ]
2022-08-08 14:44:48 +03:00
environment :
- PROJECT_NAME : "AndroidTemplateProject"
2021-09-24 11:02:07 +03:00
steps :
2022-08-08 14:44:48 +03:00
- checkout_code_with_cache
2021-09-24 11:02:07 +03:00
- run_yarn
2022-02-09 19:23:43 +03:00
- attach_workspace :
at : .
2021-09-24 11:02:07 +03:00
- run :
2022-02-09 19:23:43 +03:00
name : Create Android template project
2021-09-24 11:02:07 +03:00
command : |
2022-02-09 19:23:43 +03:00
REPO_ROOT=$(pwd)
2022-08-08 14:44:48 +03:00
node ./scripts/set-rn-template-version.js "file:$REPO_ROOT/build/$(cat build/react-native-package-version)"
2022-11-25 00:56:09 +03:00
node ./scripts/template/initialize.js --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath $REPO_ROOT --directory "/tmp/$PROJECT_NAME"
2021-09-24 11:02:07 +03:00
- run :
2022-10-28 00:40:27 +03:00
name : Build the template application for << parameters.flavor >> with Architecture set to << parameters.architecture >>, and using the << parameters.jsengine>> JS engine.
2022-10-25 23:13:14 +03:00
command : |
cd /tmp/$PROJECT_NAME/android/
2022-10-28 00:40:27 +03:00
if [[ << parameters.architecture >> == "NewArch" ]]; then
export ORG_GRADLE_PROJECT_newArchEnabled=true
else
export ORG_GRADLE_PROJECT_newArchEnabled=false
fi
if [[ << parameters.jsengine >> == "Hermes" ]]; then
export ORG_GRADLE_PROJECT_hermesEnabled=true
else
export ORG_GRADLE_PROJECT_hermesEnabled=false
fi
./gradlew assemble<< parameters.flavor >> -PREACT_NATIVE_MAVEN_LOCAL_REPO=/root/react-native/maven-local
2021-09-24 11:02:07 +03:00
2022-11-24 21:21:57 +03:00
- store_artifacts :
path : /tmp/$PROJECT_NAME/android/app/build/outputs/apk/
destination : template-apk
2021-10-29 01:46:53 +03:00
# -------------------------
# JOBS: Test iOS Template
# -------------------------
test_ios_template :
executor : reactnativeios
2022-08-31 18:54:06 +03:00
parameters :
flavor :
default : "Debug"
2022-10-13 23:03:45 +03:00
description : The Xcode build type. Must be one of "Debug", "Release".
type : enum
enum : [ "Debug" , "Release" ]
2022-08-31 18:54:06 +03:00
architecture :
default : "OldArch"
2022-10-13 23:03:45 +03:00
description : Which React Native architecture to use. Must be one of "NewArch", "OldArch".
type : enum
enum : [ "NewArch" , "OldArch" ]
2022-08-31 18:54:06 +03:00
jsengine :
default : "Hermes"
2022-10-13 23:03:45 +03:00
description : Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type : enum
enum : [ "Hermes" , "JSC" ]
2022-09-06 13:25:45 +03:00
flipper :
default : "WithFlipper"
2022-10-13 23:03:45 +03:00
description : Whether Flipper is enabled. Must be one of "WithFlipper", "WithoutFlipper".
type : enum
enum : [ "WithFlipper" , "WithoutFlipper" ]
2022-11-29 19:53:50 +03:00
use_frameworks :
default : "StaticLibraries"
description : Which kind of option we want to use for `use_frameworks!`
type : enum
enum : [ "StaticLibraries" , "StaticFrameworks" ] #TODO : Add "DynamicFrameworks"
2021-10-29 01:46:53 +03:00
environment :
- PROJECT_NAME : "iOSTemplateProject"
2022-06-09 21:18:30 +03:00
- HERMES_WS_DIR : *hermes_workspace_root
2021-10-29 01:46:53 +03:00
steps :
2022-05-18 17:43:51 +03:00
- checkout_code_with_cache
2021-10-29 01:46:53 +03:00
- run_yarn
- attach_workspace :
at : .
2022-06-09 21:18:30 +03:00
- *attach_hermes_workspace
2022-08-31 18:54:06 +03:00
- when :
condition :
equal : [ "Hermes" , << parameters.jsengine >>]
steps :
- run :
name : Set HERMES_ENGINE_TARBALL_PATH
command : |
2022-11-14 19:31:30 +03:00
BUILD_TYPE="<< parameters.flavor >>"
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $BASH_ENV
2021-10-29 01:46:53 +03:00
- run :
name : Create iOS template project
command : |
REPO_ROOT=$(pwd)
PACKAGE=$(cat build/react-native-package-version)
PATH_TO_PACKAGE="$REPO_ROOT/build/$PACKAGE"
node ./scripts/set-rn-template-version.js "file:$PATH_TO_PACKAGE"
2022-11-25 00:56:09 +03:00
node ./scripts/template/initialize.js --reactNativeRootPath $REPO_ROOT --templateName $PROJECT_NAME --templateConfigPath $REPO_ROOT --directory "/tmp/$PROJECT_NAME"
2022-08-31 18:54:06 +03:00
- run :
2022-09-06 13:25:45 +03:00
name : Install iOS dependencies - Configuration << parameters.flavor >>; New Architecture << parameters.architecture >>; JS Engine << parameters.jsengine>>; Flipper << parameters.flipper >>
2022-08-31 18:54:06 +03:00
command : |
2022-11-24 00:20:00 +03:00
cd /tmp/$PROJECT_NAME/ios
2022-08-31 18:54:06 +03:00
bundle install
if [[ << parameters.flavor >> == "Release" ]]; then
export PRODUCTION=1
fi
if [[ << parameters.architecture >> == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
if [[ << parameters.jsengine >> == "JSC" ]]; then
export USE_HERMES=0
fi
2022-09-06 13:25:45 +03:00
if [[ << parameters.flipper >> == "WithoutFlipper" ]]; then
export NO_FLIPPER=1
fi
2022-11-29 19:53:50 +03:00
if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
export USE_FRAMEWORKS=static
fi
2022-08-31 18:54:06 +03:00
bundle exec pod install
2021-10-29 01:46:53 +03:00
- run :
name : Build template project
command : |
xcodebuild build \
2022-08-31 18:54:06 +03:00
-configuration << parameters.flavor >> \
2022-08-08 14:44:48 +03:00
-workspace /tmp/$PROJECT_NAME/ios/$PROJECT_NAME.xcworkspace \
2021-10-29 01:46:53 +03:00
-scheme $PROJECT_NAME \
-sdk iphonesimulator
2022-02-03 22:08:56 +03:00
# -------------------------
# JOBS: Test iOS RNTester
# -------------------------
test_ios_rntester :
executor : reactnativeios
2022-10-04 20:15:30 +03:00
parameters :
2022-10-13 01:23:55 +03:00
jsengine :
default : "Hermes"
description : Which JavaScript engine to use. Must be one of "Hermes", "JSC".
type : enum
enum : [ "Hermes" , "JSC" ]
2022-10-13 23:03:45 +03:00
architecture :
default : "OldArch"
description : Which React Native architecture to use. Must be one of "OldArch", "NewArch".
type : enum
enum : [ "NewArch" , "OldArch" ]
2022-02-03 22:08:56 +03:00
steps :
2022-05-18 17:43:51 +03:00
- checkout_code_with_cache
2022-02-03 22:08:56 +03:00
- run_yarn
2022-08-03 13:34:29 +03:00
- *attach_hermes_workspace
2022-02-03 22:08:56 +03:00
2022-05-13 17:15:15 +03:00
# The macOS machine can run out of storage if Hermes is enabled and built from source.
# Since this job does not use the iOS Simulator, deleting it provides a quick way to
# free up space.
- run :
name : Delete iOS Simulators
background : true
command : sudo rm -rf /Library/Developer/CoreSimulator/Profiles/Runtimes/
2022-07-20 19:12:47 +03:00
- with_hermes_tarball_cache_span :
2022-08-23 16:43:01 +03:00
set_tarball_path : True
2022-05-13 22:51:09 +03:00
steps :
- run :
2022-10-04 20:15:30 +03:00
name : Install CocoaPods dependencies - Architecture << parameters.architecture >>
2022-05-13 22:51:09 +03:00
command : |
rm -rf packages/rn-tester/Pods
2022-10-04 20:15:30 +03:00
if [[ << parameters.architecture >> == "NewArch" ]]; then
export RCT_NEW_ARCH_ENABLED=1
fi
2022-10-13 01:23:55 +03:00
if [[ << parameters.jsengine >> == "JSC" ]]; then
export USE_HERMES=0
fi
2022-05-13 22:51:09 +03:00
cd packages/rn-tester && bundle exec pod install
2022-02-03 22:08:56 +03:00
- run :
name : Build RNTester
command : |
xcodebuild build \
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
-scheme RNTester \
-sdk iphonesimulator
2020-04-01 03:36:31 +03:00
# -------------------------
# JOBS: Windows
# -------------------------
test_windows :
executor :
name : win/default
parameters :
run_disabled_tests :
type : boolean
default : false
environment :
- ANDROID_HOME : "C:\\Android\\android-sdk"
2021-01-04 20:12:53 +03:00
- ANDROID_NDK : "C:\\Android\\android-sdk\\ndk\\20.1.5948944"
2022-11-09 06:12:02 +03:00
- ANDROID_BUILD_VERSION : 33
- ANDROID_TOOLS_VERSION : 33.0 .0
2020-04-01 03:36:31 +03:00
- GRADLE_OPTS : -Dorg.gradle.daemon=false
2022-12-02 18:32:30 +03:00
- CHOCO_CACHE_DIR : "C:\\ChocoCache"
2020-04-01 03:36:31 +03:00
steps :
2022-08-23 16:43:01 +03:00
- checkout_code_with_cache
2020-04-01 03:36:31 +03:00
2022-12-02 18:32:30 +03:00
- restore_cache :
keys :
- *windows_choco_cache_key
- run :
name : Choco cache
# Cache our dependencies which can be flakey to download
command : |
if (!Test-Path $env:CHOCO_CACHE_DIR) {
mkdir $env:CHOCO_CACHE_DIR
}
choco config set --name cacheLocation --value $env:CHOCO_CACHE_DIR
2021-06-04 17:18:34 +03:00
- run :
CircleCI: Use `nodejs-lts` for Windows tests (#34726)
Summary:
Currently we use `nvm install 16` in the `test_windows` CircleCI job. With the "official" non-Windows NVM, this means latest 16 (16.17.0), but that's not the case for NVM-Windows, [which simply appends `.0.0`](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L384) unless [the major version is one character long](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L210). The Windows orb includes NVM-Windows 1.1.7 (even on the latest 5.0.0 orb), which does not support `nvm install lts` (added 1.1.9). Updating NVM isn't trivial as the system/orb version takes precedence over any Chocolately installation.
Running tests on 16.0.0 blocks Jest 29, which requires [`^16.10.0`](https://github.com/facebook/jest/blob/v29.0.3/packages/jest-create-cache-key-function/package.json#L17).
I initially tried installing a specific Node JS version with NVM, but NVM-Windows 1.1.7 doesn't support newer Node versions due to https://github.com/npm/cli/issues/4234.
So this PR switches from using NVM-Windows to just using Chocolately Node JS packages. `nodejs-lts` tracks the latest LTS. IMO, given we're only testing against one Node JS version with Windows, the latest LTS is a good option, but versions can be specified with `--version` if we want to pin it instead.
Yarn is available through [corepack](https://nodejs.org/api/corepack.html#corepack) since 16.9, so doesn't need to be installed separately.
## Changelog
[Internal] [Fixed] - CircleCI: Update Node JS version used on Windows tests from 16.0.0 to 16.17.0
Pull Request resolved: https://github.com/facebook/react-native/pull/34726
Test Plan: Tested via painful trial and error on my fork: https://app.circleci.com/pipelines/github/robhogan/react-native/19/workflows/0c23a77f-40d2-4c36-933b-53c14acb7907
Reviewed By: cipolleschi
Differential Revision: D39647377
Pulled By: robhogan
fbshipit-source-id: 733da49c632eab26a09ba9cd0175419b9144f9d2
2022-09-20 13:32:04 +03:00
name : Disable NVM
# Use choco to manage node versions due to https://github.com/npm/cli/issues/4234
command : nvm off
- run :
name : Install Node JS
2021-06-04 17:18:34 +03:00
# Note: Version set separately for non-Windows builds, see above.
CircleCI: Use `nodejs-lts` for Windows tests (#34726)
Summary:
Currently we use `nvm install 16` in the `test_windows` CircleCI job. With the "official" non-Windows NVM, this means latest 16 (16.17.0), but that's not the case for NVM-Windows, [which simply appends `.0.0`](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L384) unless [the major version is one character long](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L210). The Windows orb includes NVM-Windows 1.1.7 (even on the latest 5.0.0 orb), which does not support `nvm install lts` (added 1.1.9). Updating NVM isn't trivial as the system/orb version takes precedence over any Chocolately installation.
Running tests on 16.0.0 blocks Jest 29, which requires [`^16.10.0`](https://github.com/facebook/jest/blob/v29.0.3/packages/jest-create-cache-key-function/package.json#L17).
I initially tried installing a specific Node JS version with NVM, but NVM-Windows 1.1.7 doesn't support newer Node versions due to https://github.com/npm/cli/issues/4234.
So this PR switches from using NVM-Windows to just using Chocolately Node JS packages. `nodejs-lts` tracks the latest LTS. IMO, given we're only testing against one Node JS version with Windows, the latest LTS is a good option, but versions can be specified with `--version` if we want to pin it instead.
Yarn is available through [corepack](https://nodejs.org/api/corepack.html#corepack) since 16.9, so doesn't need to be installed separately.
## Changelog
[Internal] [Fixed] - CircleCI: Update Node JS version used on Windows tests from 16.0.0 to 16.17.0
Pull Request resolved: https://github.com/facebook/react-native/pull/34726
Test Plan: Tested via painful trial and error on my fork: https://app.circleci.com/pipelines/github/robhogan/react-native/19/workflows/0c23a77f-40d2-4c36-933b-53c14acb7907
Reviewed By: cipolleschi
Differential Revision: D39647377
Pulled By: robhogan
fbshipit-source-id: 733da49c632eab26a09ba9cd0175419b9144f9d2
2022-09-20 13:32:04 +03:00
command : choco install nodejs-lts
2021-06-04 17:18:34 +03:00
2020-04-01 03:36:31 +03:00
# Setup Dependencies
- run :
CircleCI: Use `nodejs-lts` for Windows tests (#34726)
Summary:
Currently we use `nvm install 16` in the `test_windows` CircleCI job. With the "official" non-Windows NVM, this means latest 16 (16.17.0), but that's not the case for NVM-Windows, [which simply appends `.0.0`](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L384) unless [the major version is one character long](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L210). The Windows orb includes NVM-Windows 1.1.7 (even on the latest 5.0.0 orb), which does not support `nvm install lts` (added 1.1.9). Updating NVM isn't trivial as the system/orb version takes precedence over any Chocolately installation.
Running tests on 16.0.0 blocks Jest 29, which requires [`^16.10.0`](https://github.com/facebook/jest/blob/v29.0.3/packages/jest-create-cache-key-function/package.json#L17).
I initially tried installing a specific Node JS version with NVM, but NVM-Windows 1.1.7 doesn't support newer Node versions due to https://github.com/npm/cli/issues/4234.
So this PR switches from using NVM-Windows to just using Chocolately Node JS packages. `nodejs-lts` tracks the latest LTS. IMO, given we're only testing against one Node JS version with Windows, the latest LTS is a good option, but versions can be specified with `--version` if we want to pin it instead.
Yarn is available through [corepack](https://nodejs.org/api/corepack.html#corepack) since 16.9, so doesn't need to be installed separately.
## Changelog
[Internal] [Fixed] - CircleCI: Update Node JS version used on Windows tests from 16.0.0 to 16.17.0
Pull Request resolved: https://github.com/facebook/react-native/pull/34726
Test Plan: Tested via painful trial and error on my fork: https://app.circleci.com/pipelines/github/robhogan/react-native/19/workflows/0c23a77f-40d2-4c36-933b-53c14acb7907
Reviewed By: cipolleschi
Differential Revision: D39647377
Pulled By: robhogan
fbshipit-source-id: 733da49c632eab26a09ba9cd0175419b9144f9d2
2022-09-20 13:32:04 +03:00
name : Enable Yarn with corepack
command : corepack enable
2020-04-01 03:36:31 +03:00
- run :
name : Display Environment info
command : npx envinfo@latest
- restore_cache :
keys :
2022-05-12 21:08:29 +03:00
- *windows_yarn_cache_key
2020-04-01 03:36:31 +03:00
- run :
name : "Yarn: Install Dependencies"
command : yarn install --frozen-lockfile --non-interactive
2022-12-02 18:32:30 +03:00
2020-04-01 03:36:31 +03:00
- save_cache :
2022-05-12 21:08:29 +03:00
key : *windows_yarn_cache_key
2020-04-01 03:36:31 +03:00
paths :
- C:\Users\circleci\AppData\Local\Yarn
- run :
name : Install Android SDK Tools
2022-12-02 18:32:30 +03:00
command : choco install android-sdk;
- save_cache :
key : *windows_choco_cache_key
paths :
- $env:CHOCO_CACHE_DIR
2020-04-01 03:36:31 +03:00
- run :
name : Setup Android SDKs
command : |
sdkmanager --licenses
2020-10-21 02:58:29 +03:00
sdkmanager "system-images;android-21;google_apis;armeabi-v7a"
2020-04-01 03:36:31 +03:00
sdkmanager "platforms;android-%ANDROID_BUILD_VERSION%"
sdkmanager "build-tools;%ANDROID_TOOLS_VERSION%"
sdkmanager "add-ons;addon-google_apis-google-23"
sdkmanager "extras;android;m2repository"
# -------------------------
# Run Tests
- run :
name : "Flow: Check Android"
command : yarn flow-check-android
- run :
name : "Flow: Check iOS"
command : yarn flow-check-ios
- run :
name : "Run Tests: JavaScript Tests"
command : yarn test
# Optionally, run disabled tests
- when :
condition : << parameters.run_disabled_tests >>
steps :
- run : echo "Failing tests may be moved here temporarily."
- run :
name : Android Build
2020-08-20 03:54:30 +03:00
command : ./gradlew.bat packages:rn-tester:android:app:assembleRelease
2020-04-01 03:36:31 +03:00
2019-02-24 04:01:34 +03:00
# -------------------------
# JOBS: Coverage
# -------------------------
# Collect JavaScript test coverage
2018-12-01 06:45:56 +03:00
js_coverage :
2020-02-14 10:11:41 +03:00
executor : nodelts
2018-12-03 22:44:07 +03:00
environment :
- CI_BRANCH : $CIRCLE_BRANCH
- CI_PULL_REQUEST : $CIRCLE_PULL_REQUEST
- CI_BUILD_NUMBER : $CIRCLE_BUILD_NUM
- CI_BUILD_URL : $CIRCLE_BUILD_URL
2018-12-01 06:45:56 +03:00
steps :
2022-08-23 16:43:01 +03:00
- checkout
2019-05-31 01:07:45 +03:00
- setup_artifacts
- run_yarn
2019-02-24 04:01:34 +03:00
- run :
2019-12-12 23:17:29 +03:00
name : Collect test coverage information
2019-02-24 04:01:34 +03:00
command : |
2019-12-12 23:17:29 +03:00
scripts/circleci/exec_swallow_error.sh yarn test --coverage --maxWorkers=2
if [[ -e ./coverage/lcov.info ]]; then
cat ./coverage/lcov.info | scripts/circleci/exec_swallow_error.sh ./node_modules/.bin/coveralls
fi
2018-12-01 06:45:56 +03:00
- store_artifacts :
path : ~/react-native/coverage/
2022-03-08 04:02:08 +03:00
# -------------------------
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
# JOBS: Build Hermes
2022-03-08 04:02:08 +03:00
# -------------------------
2022-04-02 10:02:11 +03:00
prepare_hermes_workspace :
2022-03-08 04:02:08 +03:00
docker :
2022-09-08 18:19:11 +03:00
- image : debian:11
2022-03-08 04:02:08 +03:00
environment :
- HERMES_WS_DIR : *hermes_workspace_root
2022-05-06 18:02:33 +03:00
- HERMES_VERSION_FILE : "sdks/.hermesversion"
2023-01-05 17:58:38 +03:00
- BUILD_FROM_SOURCE : true
2022-03-08 04:02:08 +03:00
steps :
- run :
name : Install dependencies
command : |
2022-05-06 18:02:33 +03:00
apt update
2022-05-13 10:08:04 +03:00
apt install -y wget git curl
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt install -y nodejs
npm install --global yarn
2022-08-23 16:43:01 +03:00
- checkout
2022-05-13 10:08:04 +03:00
- run_yarn
2022-03-08 04:02:08 +03:00
- run :
2022-05-06 18:02:33 +03:00
name : Set up Hermes workspace and caching
command : |
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
if [ -f "$HERMES_VERSION_FILE" ]; then
cat $HERMES_VERSION_FILE > /tmp/hermes/hermesversion
else
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
echo $HERMES_TAG_SHA > /tmp/hermes/hermesversion
fi
2022-08-03 13:34:29 +03:00
cat /tmp/hermes/hermesversion
2022-05-06 18:02:33 +03:00
- restore_cache :
2022-09-22 23:41:51 +03:00
key : *hermes_workspace_cache_key
2022-03-23 23:18:52 +03:00
- run :
name : Download Hermes tarball
2022-03-08 04:02:08 +03:00
command : |
2022-07-20 18:53:38 +03:00
node scripts/hermes/prepare-hermes-for-build $CIRCLE_PULL_REQUEST
2022-05-13 10:08:04 +03:00
cp sdks/download/* $HERMES_WS_DIR/download/.
cp -r sdks/hermes/* $HERMES_WS_DIR/hermes/.
2022-08-03 13:34:29 +03:00
cat /tmp/hermes/hermesversion
2022-05-06 18:02:33 +03:00
- save_cache :
2022-09-22 23:41:51 +03:00
key : *hermes_workspace_cache_key
2022-05-06 18:02:33 +03:00
paths :
- /tmp/hermes/download/
- /tmp/hermes/hermes/
2022-03-08 04:02:08 +03:00
- persist_to_workspace :
root : *hermes_workspace_root
paths :
2022-03-23 23:18:52 +03:00
- download
2022-03-08 04:02:08 +03:00
- hermes
2022-03-23 23:18:52 +03:00
- hermesversion
2022-03-08 04:02:08 +03:00
2022-04-02 10:02:11 +03:00
build_hermesc_linux :
2022-03-08 04:02:08 +03:00
docker :
2022-04-27 21:48:25 +03:00
- image : debian:bullseye
resource_class : "xlarge"
working_directory : /root
2022-03-08 04:02:08 +03:00
steps :
- run :
name : Install dependencies
command : |
2022-04-27 21:48:25 +03:00
apt update
apt install -y git openssh-client cmake build-essential \
libreadline-dev libicu-dev zip python3
- *attach_hermes_workspace
2022-05-06 18:02:33 +03:00
- restore_cache :
2022-09-22 23:41:51 +03:00
key : *hermes_workspace_cache_key
2022-03-08 04:02:08 +03:00
- run :
name : Set up workspace
command : |
2022-04-27 21:48:25 +03:00
mkdir -p /tmp/hermes/linux64-bin
2022-03-08 04:02:08 +03:00
- run :
2022-04-27 21:48:25 +03:00
name : Build HermesC for Linux
2022-03-08 04:02:08 +03:00
command : |
2022-05-06 18:02:33 +03:00
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
else
cd /tmp/hermes
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
cmake --build build --target check-hermes -j 4
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
fi
- save_cache :
2022-09-22 23:41:51 +03:00
key : *hermes_workspace_cache_key
2022-05-06 18:02:33 +03:00
paths :
- /tmp/hermes/linux64-bin/
- /tmp/hermes/hermes/destroot/
2022-04-27 21:48:25 +03:00
- store_artifacts :
path : /tmp/hermes/linux64-bin/
2022-03-23 23:18:52 +03:00
- persist_to_workspace :
2022-04-27 21:48:25 +03:00
root : /tmp/hermes/
2022-03-23 23:18:52 +03:00
paths :
2022-04-27 21:48:25 +03:00
- linux64-bin
2022-03-08 04:02:08 +03:00
2022-05-23 22:14:29 +03:00
build_hermes_macos :
2022-09-22 23:41:51 +03:00
parameters :
flavor :
default : "Debug"
2022-10-19 00:25:38 +03:00
description : The Hermes build type. Must be one of "Debug", "Release".
type : enum
enum : [ "Debug" , "Release" ]
2022-04-02 02:19:29 +03:00
executor : reactnativeios
2022-03-08 04:02:08 +03:00
environment :
- HERMES_WS_DIR : *hermes_workspace_root
2022-10-07 20:21:25 +03:00
- HERMES_TARBALL_ARTIFACTS_DIR : *hermes_tarball_artifacts_dir
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
- HERMES_OSXBIN_ARTIFACTS_DIR : *hermes_osxbin_artifacts_dir
2022-03-08 04:02:08 +03:00
steps :
2022-05-18 17:43:51 +03:00
- checkout_code_with_cache
2022-10-07 20:21:25 +03:00
- run_yarn
2022-03-08 04:02:08 +03:00
- *attach_hermes_workspace
2022-12-13 15:19:43 +03:00
- get_react_native_version
2022-09-22 23:41:51 +03:00
- when :
condition :
equal : [ << parameters.flavor >>, "Debug"]
steps :
- restore_cache :
keys :
- *hermes_workspace_debug_cache_key
- when :
condition :
equal : [ << parameters.flavor >>, "Release"]
steps :
- restore_cache :
keys :
- *hermes_workspace_release_cache_key
2022-04-27 21:48:25 +03:00
- run :
name : Set up workspace
command : |
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
mkdir -p $HERMES_OSXBIN_ARTIFACTS_DIR ./sdks/hermes
cp -r $HERMES_WS_DIR/hermes/* ./sdks/hermes/.
2022-09-22 23:41:51 +03:00
- brew_install :
package : cmake
2022-07-20 19:12:47 +03:00
- with_hermes_tarball_cache_span :
2022-09-22 23:41:51 +03:00
flavor : << parameters.flavor >>
2022-07-20 19:12:47 +03:00
steps :
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
- with_hermesc_span :
2022-10-19 00:25:38 +03:00
flavor : << parameters.flavor >>
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
steps :
- run :
name : Build the Hermes Mac frameworks
command : |
cd ./sdks/hermes || exit 1
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-mac-framework.sh
- run :
name : Build the Hermes iOS frameworks
command : |
cd ./sdks/hermes || exit 1
BUILD_TYPE="<< parameters.flavor >>" ./utils/build-ios-framework.sh
2022-07-20 19:12:47 +03:00
- run :
name : Package the Hermes Apple frameworks
command : |
2022-10-07 20:21:25 +03:00
BUILD_TYPE="<< parameters.flavor >>"
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
2022-09-22 23:41:51 +03:00
2022-11-14 19:31:30 +03:00
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
2022-10-07 20:21:25 +03:00
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
TARBALL_OUTPUT_PATH=$(node ./scripts/hermes/create-tarball.js \
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
--inputDir ./sdks/hermes \
2022-10-07 20:21:25 +03:00
--buildType "$BUILD_TYPE" \
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
--outputDir $TARBALL_OUTPUT_DIR)
2022-09-22 23:41:51 +03:00
2022-10-07 20:21:25 +03:00
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
2022-07-20 19:12:47 +03:00
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
2022-09-22 23:41:51 +03:00
- when :
condition :
equal : [ << parameters.flavor >>, "Debug"]
steps :
- save_cache :
key : *hermes_workspace_debug_cache_key
paths : *hermes_workspace_macos_cache_paths
- when :
condition :
equal : [ << parameters.flavor >>, "Release"]
steps :
- save_cache :
key : *hermes_workspace_release_cache_key
paths : *hermes_workspace_macos_cache_paths
2022-07-20 19:12:47 +03:00
- store_artifacts :
2022-10-07 20:21:25 +03:00
path : *hermes_tarball_artifacts_dir
2022-07-20 19:12:47 +03:00
- store_artifacts :
Circle CI: Reduce build_hermes_macos Hermes SDK cache size by 75% (#34886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34886
## Reduced cache size
The `build_hermes_macos` job can spend over 20 minutes restoring cached build artifacts (over 5 GB), when only `build_macosx` and `destroot` are required to be cached: `build_macosx` as it may contain a pre-built `hermesc` from previous builds, and `destroot` which contains the artifacts for previous iOS/macOS builds.
This is the `build_hermes_macos` Restore Cache step, before the changes in this diff:
```
Found a cache from build 308044 at v1-hermes-build_hermes_macos-debug-PEiMHp9XQ13KtYFQMKoT27DmHkkoxOi_PJUyW7PacZE=
Size: 5.2 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_host_hermesc
* /Users/distiller/react-native/sdks/hermes/build_iphoneos
* /Users/distiller/react-native/sdks/hermes/build_catalyst
* /Users/distiller/react-native/sdks/hermes/build_iphonesimulator
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 5.2 GiB
Time to restore cache: 183s
This is the `build_hermes_macos` Restore Cache step, after the changes in this diff:
```
Found a cache from build 310128 at v2-hermes-build_hermes_macos-debug-e7WmoA0+mfveXq1zsMYpgR6BYqVuuDjmVeLLyjqPJWk=
Size: 1.3 GiB
Cached paths:
* /Users/distiller/react-native/sdks/hermes/build_macosx
* /Users/distiller/react-native/sdks/hermes/destroot
Downloading cache archive...
Unarchiving cache...
```
Size: 1.3 GiB
Time to restore cache: 42s
**This is a size reduction of 75%, and execution time reduction of 77%.**
This savings will apply to every workflow that runs afterwards until the Hermes cache is invalidated due to a new commit landing in `facebook/hermes`.
## Added `export_hermesc`
As part of the work mentioned above, a reusable `export_hermesc` command was added, which will export hermesc for use in downstream steps. Either of the macOS or iOS build scripts will generate this binary. As we now only cache the macOS build dir, that version is loaded from cache by default if available:
- If the cache contains hermesc, both the macOS and iOS builds will use it.
- If the cache does not contain hermesc, then the iOS job will use the hermesc that was built by the macOS job previously.
- The `export_hermesc` command will work regardless of the order of the Hermes build scripts
## Refactoring of magic strings into reusable yaml references
Some additional changes to the Circle CI config were done in order to reduce repetition of artifacts/cache paths that are re-used across workflows.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D40153737
fbshipit-source-id: b9f07302ccc9bac1ce72a09b944d3210e6db2ec1
2022-10-12 19:55:31 +03:00
path : *hermes_osxbin_artifacts_dir
2022-07-20 19:12:47 +03:00
- persist_to_workspace :
root : /tmp/hermes/
paths :
- hermes-runtime-darwin
- osx-bin
2022-03-08 04:02:08 +03:00
2022-04-02 10:02:11 +03:00
build_hermesc_windows :
2022-03-08 04:02:08 +03:00
executor :
name : win/default
shell : powershell.exe
environment :
- HERMES_WS_DIR : 'C:\tmp\hermes'
- ICU_URL : "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
- MSBUILD_DIR : 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
- CMAKE_DIR : 'C:\Program Files\CMake\bin'
steps :
- *attach_hermes_workspace
2022-05-06 18:02:33 +03:00
- restore_cache :
2022-05-12 21:08:29 +03:00
key : *hermes_windows_cache_key
2022-03-08 04:02:08 +03:00
- run :
name : Set up workspace
command : |
New-Item -ItemType Directory $Env:HERMES_WS_DIR
New-Item -ItemType Directory $Env:HERMES_WS_DIR\icu
New-Item -ItemType Directory $Env:HERMES_WS_DIR\deps
2022-04-27 21:48:25 +03:00
New-Item -ItemType Directory $Env:HERMES_WS_DIR\win64-bin
2022-03-08 04:02:08 +03:00
New-Item -ItemType SymbolicLink -Target tmp\hermes\hermes -Path $Env:HERMES_WS_DIR -Name hermes
- run :
2022-04-27 21:48:25 +03:00
name : Build HermesC for Windows
2022-03-08 04:02:08 +03:00
command : |
2022-05-06 18:02:33 +03:00
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
2022-09-29 17:22:39 +03:00
choco install --no-progress cmake --version 3.14.7
2022-05-06 18:02:33 +03:00
if (-not $?) { throw "Failed to install CMake" }
2022-09-29 17:22:39 +03:00
choco install --no-progress python3
2022-05-06 18:02:33 +03:00
if (-not $?) { throw "Failed to install Python" }
cd $Env:HERMES_WS_DIR\icu
# If Invoke-WebRequest shows a progress bar, it will fail with
# Win32 internal error "Access is denied" 0x5 occurred [...]
$progressPreference = 'silentlyContinue'
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
Expand-Archive -Path "icu.zip" -DestinationPath "."
cd $Env:HERMES_WS_DIR
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
# Include MSVC++ 2015 redistributables
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
if (-not $?) { throw "Failed to configure Hermes" }
cd build_release
cmake --build . --target hermesc --config Release
if (-not $?) { throw "Failed to build Hermes" }
cd $Env:HERMES_WS_DIR
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
# Include Windows runtime dependencies
Copy-Item -Path "deps\*" -Destination "win64-bin"
}
else {
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
}
- save_cache :
2022-05-12 21:08:29 +03:00
key : *hermes_windows_cache_key
2022-05-06 18:02:33 +03:00
paths :
- C:\tmp\hermes\win64-bin\
- C:\tmp\hermes\hermes\icu\
- C:\tmp\hermes\hermes\deps\
- C:\tmp\hermes\hermes\build_release\
2022-04-27 21:48:25 +03:00
- store_artifacts :
2022-05-06 18:02:33 +03:00
path : C:\tmp\hermes\win64-bin\
2022-03-08 04:02:08 +03:00
- persist_to_workspace :
2022-05-06 18:02:33 +03:00
root : C:\tmp\hermes\
2022-03-08 04:02:08 +03:00
paths :
2022-04-27 21:48:25 +03:00
- win64-bin
2022-03-08 04:02:08 +03:00
2019-02-24 04:01:34 +03:00
# -------------------------
# JOBS: Releases
# -------------------------
2021-12-01 03:48:47 +03:00
prepare_package_for_release :
2022-01-25 01:06:49 +03:00
parameters :
version :
type : string
latest :
type : boolean
default : false
2022-10-20 03:54:22 +03:00
dryrun :
type : boolean
default : false
2021-12-01 03:48:47 +03:00
executor : reactnativeios
steps :
2022-05-18 17:43:51 +03:00
- checkout_code_with_cache
2021-12-04 00:15:38 +03:00
- run_yarn
2021-12-01 03:48:47 +03:00
- add_ssh_keys :
fingerprints :
2023-01-09 15:34:41 +03:00
- "1f:c7:61:c4:e2:ff:77:e3:cc:ca:a7:34:c2:79:e3:3c"
2022-10-13 02:19:28 +03:00
- brew_install :
package : cmake
2021-12-01 03:48:47 +03:00
- run :
name : "Set new react-native version and commit changes"
command : |
2022-11-21 21:52:17 +03:00
VERSION=<< parameters.version >>
if [[ -z "$VERSION" ]]; then
VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | head -1)
echo "Using the version from the package.json: $VERSION"
fi
node ./scripts/prepare-package-for-release.js -v "$VERSION" -l << parameters.latest >> --dry-run << parameters.dryrun >>
2021-12-01 03:48:47 +03:00
2021-09-29 02:26:08 +03:00
build_npm_package :
2020-03-14 07:46:45 +03:00
parameters :
2022-10-20 03:54:22 +03:00
release_type :
description : The type of release to build. Must be one of "nightly", "release", "dry-run".
type : enum
enum : [ "nightly" , "release" , "dry-run" ]
default : "dry-run"
2019-05-31 01:07:45 +03:00
executor : reactnativeandroid
2022-03-23 23:18:52 +03:00
environment :
- HERMES_WS_DIR : *hermes_workspace_root
2018-07-23 23:28:17 +03:00
steps :
2020-03-24 21:04:57 +03:00
- run :
name : Add github.com to SSH known hosts
command : |
mkdir -p ~/.ssh
echo '|1|If6MU203eXTaaWL678YEfWkVMrw=|kqLeIAyTy8pzpj8x8Ae4Fr8Mtlc= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' >> ~/.ssh/known_hosts
2022-08-23 16:43:01 +03:00
- checkout
2022-04-20 23:03:29 +03:00
- *attach_hermes_workspace
- run :
2022-10-14 17:30:29 +03:00
name : Copy Hermes binaries
2022-04-20 23:03:29 +03:00
command : |
2022-04-27 21:48:25 +03:00
mkdir -p ./sdks/hermesc ./sdks/hermesc/osx-bin ./sdks/hermesc/win64-bin ./sdks/hermesc/linux64-bin
2022-10-19 00:25:38 +03:00
# When build_hermes_macos runs as a matrix, it outputs
if [[ -d $HERMES_WS_DIR/osx-bin/Release ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Release/* ./sdks/hermesc/osx-bin/.
elif [[ -d $HERMES_WS_DIR/osx-bin/Debug ]]; then
cp -r $HERMES_WS_DIR/osx-bin/Debug/* ./sdks/hermesc/osx-bin/.
else
ls $HERMES_WS_DIR/osx-bin || echo "hermesc macOS artifacts directory missing."
echo "Could not locate macOS hermesc binary."; exit 1;
fi
2022-04-27 21:48:25 +03:00
cp -r $HERMES_WS_DIR/win64-bin/* ./sdks/hermesc/win64-bin/.
cp -r $HERMES_WS_DIR/linux64-bin/* ./sdks/hermesc/linux64-bin/.
2022-10-14 17:30:29 +03:00
mkdir -p ./ReactAndroid/external-artifacts/artifacts/
2022-11-14 19:31:30 +03:00
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
2022-04-01 12:41:04 +03:00
2019-05-31 01:07:45 +03:00
- run_yarn
- download_gradle_dependencies
2022-03-23 23:18:52 +03:00
# START: Stables and nightlies
# This conditional step sets up the necessary credentials for publishing react-native to npm,
# and for interacting with GitHub as the react-native-bot account. Important: these steps
# should not be allowed to run on commits from pull requests.
2021-09-29 02:26:08 +03:00
- when :
condition :
or :
2022-10-20 03:54:22 +03:00
- equal : [ "release" , << parameters.release_type >> ]
- equal : [ "nightly" , << parameters.release_type >> ]
2021-09-29 02:26:08 +03:00
steps :
- run : echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
2022-03-23 23:18:52 +03:00
# END: Stables and nightlies
2022-10-20 03:54:22 +03:00
- run : node ./scripts/publish-npm.js --<< parameters.release_type >>
2022-05-06 20:50:10 +03:00
- run :
name : Zip Hermes Native Symbols
command : zip -r /tmp/hermes-native-symbols.zip ~/react-native/ReactAndroid/hermes-engine/build/intermediates/cmake/
- store_artifacts :
path : /tmp/hermes-native-symbols.zip
2022-10-25 23:13:14 +03:00
- run :
name : Zip Maven Artifacts from /tmp/maven-local
command : zip -r /tmp/maven-local.zip /tmp/maven-local
- store_artifacts :
path : /tmp/maven-local.zip
- persist_to_workspace :
root : /tmp
paths :
- maven-local
2022-03-23 23:18:52 +03:00
# START: Commitlies
# Provide a react-native package for this commit as a Circle CI release artifact.
2021-09-24 23:47:36 +03:00
- when :
condition :
2022-10-20 03:54:22 +03:00
equal : [ "dry-run" , << parameters.release_type >> ]
2021-09-24 23:47:36 +03:00
steps :
2021-09-25 20:04:47 +03:00
- run :
name : Build release package as a job artifact
command : |
mkdir -p build
FILENAME=$(npm pack)
mv $FILENAME build/
2021-10-29 01:46:53 +03:00
echo $FILENAME > build/react-native-package-version
2021-09-24 23:47:36 +03:00
- store_artifacts :
2021-09-25 20:04:47 +03:00
path : ~/react-native/build/
2021-09-24 23:47:36 +03:00
destination : build
2021-10-29 01:46:53 +03:00
- persist_to_workspace :
root : .
paths :
- build/*
2022-03-23 23:18:52 +03:00
# END: Commitlies
2021-10-29 01:46:53 +03:00
2022-03-23 23:18:52 +03:00
# START: Commits from pull requests
# When building commits from pull requests, leave a comment on the PR with a link to build artifacts
2021-10-09 03:53:18 +03:00
- when :
condition :
matches : { pattern: '^pull\/.*$', value : << pipeline.git.branch >> }
steps :
- run :
name : Post link to PR build artifacts (pull-bot)
2021-11-06 03:27:23 +03:00
command : GITHUB_TOKEN="$PUBLIC_PULLBOT_GITHUB_TOKEN_A""$PUBLIC_PULLBOT_GITHUB_TOKEN_B" scripts/circleci/post-artifacts-link.sh || true
2022-03-23 23:18:52 +03:00
# END: Commits from pull requests
2018-07-23 23:28:17 +03:00
2022-03-23 23:18:52 +03:00
# START: Stable releases
2021-11-12 22:31:21 +03:00
- when :
condition :
2022-10-20 03:54:22 +03:00
equal : [ "release" , << parameters.release_type >> ]
2021-11-12 22:31:21 +03:00
steps :
- run :
name : Update rn-diff-purge to generate upgrade-support diff
command : |
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
-H "Accept: application/vnd.github.v3+json" \
2023-01-11 21:58:25 +03:00
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
2021-11-12 22:31:21 +03:00
-d "{\"event_type\": \"publish\", \"client_payload\": { \"version\": \"${CIRCLE_TAG:1}\" }}"
2022-10-20 03:54:22 +03:00
# END: Stable releases
2020-02-27 05:07:09 +03:00
# -------------------------
# JOBS: Nightly
# -------------------------
nightly_job :
2021-10-02 01:31:24 +03:00
machine :
image : ubuntu-2004:202010-01
2020-02-27 05:07:09 +03:00
steps :
- run :
name : Nightly
command : |
echo "Nightly build run"
2022-12-14 13:17:16 +03:00
find_and_publish_bumped_packages :
executor : reactnativeandroid
steps :
- checkout
- run :
name : Set NPM auth token
command : echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
- run :
name : Find and publish all bumped packages
command : node ./scripts/monorepo/find-and-publish-all-bumped-packages.js
2022-01-25 01:06:49 +03:00
# -------------------------
# PIPELINE PARAMETERS
# -------------------------
parameters :
run_package_release_workflow_only :
default : false
type : boolean
release_latest :
default : false
type : boolean
release_version :
default : "9999"
type : string
2019-02-24 04:01:34 +03:00
# -------------------------
# WORK FLOWS
2022-01-25 01:06:49 +03:00
#
# When creating a new workflow, make sure to include condition `unless: << pipeline.parameters.run_package_release_workflow_only >>`
# It's setup this way so we can trigger a release via a POST
# See limitations: https://support.circleci.com/hc/en-us/articles/360050351292-How-to-trigger-a-workflow-via-CircleCI-API-v2
2019-02-24 04:01:34 +03:00
# -------------------------
2017-09-21 23:34:02 +03:00
workflows :
2020-02-27 05:07:09 +03:00
version : 2
2018-02-13 19:08:18 +03:00
tests :
2022-01-25 01:06:49 +03:00
unless : << pipeline.parameters.run_package_release_workflow_only >>
2017-09-21 23:34:02 +03:00
jobs :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
- build_hermesc_linux :
2022-03-23 23:18:52 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2022-05-23 22:14:29 +03:00
- build_hermes_macos :
2022-03-23 23:18:52 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2022-10-19 00:25:38 +03:00
matrix :
parameters :
flavor : [ "Debug" , "Release" ]
2022-04-02 10:02:11 +03:00
- build_hermesc_windows :
2022-03-23 23:18:52 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2021-10-29 01:46:53 +03:00
- build_npm_package :
# Build a release package on every untagged commit, but do not publish to npm.
2022-10-20 03:54:22 +03:00
release_type : "dry-run"
2022-04-20 23:03:29 +03:00
requires :
2022-04-27 21:48:25 +03:00
- build_hermesc_linux
2022-05-23 22:14:29 +03:00
- build_hermes_macos
2022-04-27 21:48:25 +03:00
- build_hermesc_windows
2021-09-15 11:33:10 +03:00
- test_js :
run_disabled_tests : false
- test_android :
run_disabled_tests : false
2021-09-24 11:02:07 +03:00
- test_android_template :
2022-02-09 19:23:43 +03:00
requires :
- build_npm_package
2022-08-08 14:44:48 +03:00
matrix :
parameters :
2022-10-28 00:40:27 +03:00
architecture : [ "NewArch" , "OldArch" ]
2022-09-12 22:33:07 +03:00
jsengine : [ "Hermes" , "JSC" ]
2022-08-08 14:44:48 +03:00
flavor : [ "Debug" , "Release" ]
2022-08-11 12:46:00 +03:00
- test_buck
2021-10-29 01:46:53 +03:00
- test_ios_template :
requires :
- build_npm_package
2022-08-31 18:54:06 +03:00
matrix :
parameters :
architecture : [ "NewArch" , "OldArch" ]
flavor : [ "Debug" , "Release" ]
jsengine : [ "Hermes" , "JSC" ]
2022-09-06 13:25:45 +03:00
flipper : [ "WithFlipper" , "WithoutFlipper" ]
2022-11-29 19:53:50 +03:00
use_frameworks : [ "StaticLibraries" , "StaticFrameworks" ] #TODO : make it works with DynamicFrameworks
2023-01-12 18:36:45 +03:00
exclude :
- architecture : "NewArch"
flavor : "Release"
jsengine : "Hermes"
flipper : "WithFlipper"
use_frameworks : "StaticLibraries"
- architecture : "NewArch"
flavor : "Release"
jsengine : "Hermes"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "NewArch"
flavor : "Release"
jsengine : "Hermes"
flipper : "WithoutFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "NewArch"
flavor : "Release"
jsengine : "JSC"
flipper : "WithFlipper"
use_frameworks : "StaticLibraries"
- architecture : "NewArch"
flavor : "Release"
jsengine : "JSC"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "NewArch"
flavor : "Release"
jsengine : "JSC"
flipper : "WithoutFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "OldArch"
flavor : "Release"
jsengine : "Hermes"
flipper : "WithFlipper"
use_frameworks : "StaticLibraries"
- architecture : "OldArch"
flavor : "Release"
jsengine : "Hermes"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "OldArch"
flavor : "Release"
jsengine : "JSC"
flipper : "WithFlipper"
use_frameworks : "StaticLibraries"
- architecture : "OldArch"
flavor : "Release"
jsengine : "JSC"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "NewArch"
flavor : "Debug"
jsengine : "Hermes"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "NewArch"
flavor : "Debug"
jsengine : "Hermes"
flipper : "WithoutFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "NewArch"
flavor : "Debug"
jsengine : "JSC"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "NewArch"
flavor : "Debug"
jsengine : "JSC"
flipper : "WithoutFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "OldArch"
flavor : "Debug"
jsengine : "Hermes"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
- architecture : "OldArch"
flavor : "Debug"
jsengine : "JSC"
flipper : "WithFlipper"
use_frameworks : "StaticFrameworks"
2022-07-20 19:12:47 +03:00
- test_ios_rntester :
requires :
- build_hermes_macos
2022-10-04 20:15:30 +03:00
matrix :
parameters :
architecture : [ "NewArch" , "OldArch" ]
2022-10-13 01:23:55 +03:00
jsengine : [ "Hermes" , "JSC" ]
2022-04-28 18:53:24 +03:00
- test_ios :
2022-04-21 23:49:40 +03:00
run_unit_tests : true
2022-07-20 19:12:47 +03:00
requires :
- build_hermes_macos
2022-10-13 01:23:55 +03:00
matrix :
parameters :
jsengine : [ "Hermes" , "JSC" ]
2020-12-29 01:26:55 +03:00
# DISABLED: USE_FRAMEWORKS=1 not supported by Flipper
2022-04-28 18:53:24 +03:00
# - test_ios:
# name: test_ios_frameworks
2020-12-29 01:26:55 +03:00
# use_frameworks: true
# run_unit_tests: true
2022-04-02 10:02:11 +03:00
# requires:
# - build_ios_frameworks
2019-05-31 01:07:45 +03:00
- test_js :
2020-02-14 10:11:41 +03:00
name : test_js_prev_lts
executor : nodeprevlts
2020-04-01 03:36:31 +03:00
- test_windows :
run_disabled_tests : false
2022-01-25 01:06:49 +03:00
# This workflow should only be triggered by release script
package_release :
when : << pipeline.parameters.run_package_release_workflow_only >>
2018-12-01 06:45:56 +03:00
jobs :
2022-01-25 01:06:49 +03:00
# This job will trigger publish_release workflow
2021-12-01 03:48:47 +03:00
- prepare_package_for_release :
name : prepare_package_for_release
2022-01-25 01:06:49 +03:00
version : << pipeline.parameters.release_version >>
latest : << pipeline.parameters.release_latest >>
2021-12-01 03:48:47 +03:00
2022-01-25 01:06:49 +03:00
publish_release :
unless : << pipeline.parameters.run_package_release_workflow_only >>
jobs :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace :
2022-03-23 23:18:52 +03:00
filters : *only_release_tags
2022-04-02 10:02:11 +03:00
- build_hermesc_linux :
2022-04-28 20:44:06 +03:00
filters : *only_release_tags
2022-03-23 23:18:52 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2022-05-23 22:14:29 +03:00
- build_hermes_macos :
2022-04-28 20:44:06 +03:00
filters : *only_release_tags
2022-03-23 23:18:52 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2022-09-22 23:41:51 +03:00
matrix :
parameters :
flavor : [ "Debug" , "Release" ]
2022-04-02 10:02:11 +03:00
- build_hermesc_windows :
2022-04-28 20:44:06 +03:00
filters : *only_release_tags
2022-03-23 23:18:52 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2022-01-25 01:06:49 +03:00
# This job will trigger when a version tag is pushed (by package_release)
2021-09-29 02:26:08 +03:00
- build_npm_package :
name : build_and_publish_npm_package
2021-11-12 22:31:21 +03:00
context : react-native-bot
2022-10-20 03:54:22 +03:00
release_type : "release"
2022-03-08 04:02:08 +03:00
filters : *only_release_tags
2022-04-20 23:03:29 +03:00
requires :
2022-04-27 21:48:25 +03:00
- build_hermesc_linux
2022-05-23 22:14:29 +03:00
- build_hermes_macos
2022-04-27 21:48:25 +03:00
- build_hermesc_windows
2018-06-14 23:48:15 +03:00
2022-10-20 03:54:22 +03:00
package_and_publish_release_dryrun :
jobs :
- prepare_package_for_release :
name : prepare_package_for_release
2022-11-21 21:52:17 +03:00
version : ''
2022-10-20 03:54:22 +03:00
latest : false
dryrun : true
- prepare_hermes_workspace :
requires :
- prepare_package_for_release
- build_hermesc_linux :
requires :
- prepare_hermes_workspace
- build_hermes_macos :
requires :
- prepare_hermes_workspace
matrix :
parameters :
flavor : [ "Debug" , "Release" ]
- build_hermesc_windows :
requires :
- prepare_hermes_workspace
- build_npm_package :
name : build_and_publish_npm_package
context : react-native-bot
release_type : "dry-run"
requires :
- build_hermesc_linux
- build_hermes_macos
- build_hermesc_windows
2018-12-01 06:45:56 +03:00
analysis :
2022-01-25 01:06:49 +03:00
unless : << pipeline.parameters.run_package_release_workflow_only >>
2018-12-01 06:45:56 +03:00
jobs :
2022-03-08 04:02:08 +03:00
# Run lints on every commit
- analyze_code
2019-05-31 01:07:45 +03:00
2022-05-23 11:12:25 +03:00
# Run code checks on PRs
- analyze_pr
2018-12-01 06:45:56 +03:00
2019-06-01 02:42:18 +03:00
# Gather coverage
2022-03-08 04:02:08 +03:00
- js_coverage
2021-09-15 11:33:10 +03:00
2020-02-27 05:07:09 +03:00
nightly :
2022-01-25 01:06:49 +03:00
unless : << pipeline.parameters.run_package_release_workflow_only >>
2020-02-27 05:07:09 +03:00
triggers :
- schedule :
2022-12-14 13:17:16 +03:00
<< : *main_only
2021-09-29 10:09:53 +03:00
cron : "0 20 * * *"
2020-02-27 05:07:09 +03:00
jobs :
- nightly_job
2020-03-14 07:46:45 +03:00
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
- build_hermesc_linux :
2022-03-08 04:02:08 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2022-05-23 22:14:29 +03:00
- build_hermes_macos :
2022-03-08 04:02:08 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2022-10-19 00:25:38 +03:00
matrix :
parameters :
flavor : [ "Debug" , "Release" ]
2022-04-02 10:02:11 +03:00
- build_hermesc_windows :
2022-03-08 04:02:08 +03:00
requires :
2022-04-02 10:02:11 +03:00
- prepare_hermes_workspace
2021-09-29 02:26:08 +03:00
- build_npm_package :
2022-10-20 03:54:22 +03:00
release_type : "nightly"
2022-04-20 23:03:29 +03:00
requires :
2022-04-27 21:48:25 +03:00
- build_hermesc_linux
2022-05-23 22:14:29 +03:00
- build_hermes_macos
2022-04-27 21:48:25 +03:00
- build_hermesc_windows
2022-12-14 13:17:16 +03:00
publish_bumped_packages :
jobs :
- find_and_publish_bumped_packages :
<< : *main_or_stable_only