@@ -30,53 +30,6 @@ references:
30
30
attach_workspace :
31
31
at : *hermes_workspace_root
32
32
33
- main_only : &main_only
34
- filters :
35
- branches :
36
- only : main
37
- main_or_stable_only : &main_or_stable_only
38
- filters :
39
- branches :
40
- only :
41
- - main
42
- - /0\.[0-9]+[\.[0-9]+]?-stable/
43
-
44
-
45
- # -------------------------
46
- # Dependency Anchors
47
- # -------------------------
48
- dependency_versions :
49
- xcode_version : &xcode_version "14.0.1"
50
- nodelts_image : &nodelts_image "cimg/node:18.12.1"
51
- nodeprevlts_image : &nodeprevlts_image "cimg/node:16.18.1"
52
-
53
- # -------------------------
54
- # Cache Key Anchors
55
- # -------------------------
56
- # Anchors for the cache keys
57
-
58
- cache_keys :
59
- checkout_cache_key : &checkout_cache_key v5-checkout
60
- gems_cache_key : &gems_cache_key v1-gems-{{ checksum "Gemfile.lock" }}
61
- gradle_cache_key : &gradle_cache_key v1-gradle-{{ checksum "gradle/wrapper/gradle-wrapper.properties" }}-{{ checksum "ReactAndroid/gradle.properties" }}
62
- hermes_workspace_cache_key : &hermes_workspace_cache_key v4-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
63
- 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" }}
64
- 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" }}
65
- hermes_linux_cache_key : &hermes_linux_cache_key v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
66
- hermes_windows_cache_key : &hermes_windows_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
67
- hermes_tarball_debug_cache_key : &hermes_tarball_debug_cache_key v4-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
68
- hermes_tarball_release_cache_key : &hermes_tarball_release_cache_key v3-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
69
- pods_cache_key : &pods_cache_key v8-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
70
- windows_yarn_cache_key : &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
71
- yarn_cache_key : &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
72
-
73
- cache_paths :
74
- hermes_workspace_macos_cache_paths : &hermes_workspace_macos_cache_paths
75
- - ~/react-native/sdks/hermes/build_macosx
76
- - ~/react-native/sdks/hermes/destroot
77
- hermes_tarball_cache_paths : &hermes_tarball_cache_paths
78
- - *hermes_tarball_artifacts_dir
79
-
80
33
# -------------------------
81
34
# Filters
82
35
# -------------------------
@@ -293,124 +246,7 @@ commands:
293
246
name : Report size of RNTester.app (analysis-bot)
294
247
command : GITHUB_TOKEN="$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A""$PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B" scripts/circleci/report-bundle-size.sh << parameters.platform >> || true
295
248
296
- get_react_native_version :
297
- steps :
298
- - run :
299
- name : Get React Native version
300
- command : |
301
- VERSION=$(cat package.json | jq -r '.version')
302
- # Save the react native version we are building in a file so we can use that file as part of the cache key.
303
- echo "$VERSION" > /tmp/react-native-version
304
- echo "React Native Version is $(cat /tmp/react-native-version)"
305
- HERMES_VERSION="$(cat /tmp/hermes/hermesversion)"
306
- echo "Hermes commit is $HERMES_VERSION"
307
-
308
- get_react_native_version_windows :
309
- steps :
310
- - run :
311
- name : Get React Native version on Windows
312
- command : |
313
- $VERSION=cat packages/react-native/package.json | jq -r '.version'
314
- # Save the react native version we are building in a file so we can use that file as part of the cache key.
315
- echo "$VERSION" > /tmp/react-native-version
316
- echo "React Native Version is $(cat /tmp/react-native-version)"
317
- $HERMES_VERSION=cat C:\Users\circleci\project\tmp\hermes\hermesversion
318
- echo "Hermes commit is $HERMES_VERSION"
319
-
320
- with_hermes_tarball_cache_span :
321
- parameters :
322
- steps :
323
- type : steps
324
- set_tarball_path :
325
- type : boolean
326
- default : False
327
- flavor :
328
- default : " Debug"
329
- description : The Hermes build type. Must be one of "Debug", "Release".
330
- type : enum
331
- enum : ["Debug", "Release"]
332
- hermes_tarball_artifacts_dir :
333
- type : string
334
- default : *hermes_tarball_artifacts_dir
335
- steps :
336
- - get_react_native_version
337
- - when :
338
- condition :
339
- equal : [ << parameters.flavor >>, "Debug"]
340
- steps :
341
- - restore_cache :
342
- keys :
343
- - *hermes_tarball_debug_cache_key
344
- - when :
345
- condition :
346
- equal : [ << parameters.flavor >>, "Release"]
347
- steps :
348
- - restore_cache :
349
- keys :
350
- - *hermes_tarball_release_cache_key
351
- - when :
352
- condition : << parameters.set_tarball_path >>
353
- steps :
354
- - run :
355
- name : Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
356
- command : |
357
- HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
358
- if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
359
- echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
360
- exit 0
361
- fi
362
-
363
- if [ ! -d ~/react-native ]; then
364
- echo "No React Native checkout found. Run `checkout` first."
365
- exit 0
366
- fi
367
-
368
- TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
369
- TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
370
-
371
- echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
372
- echo "$TARBALL_PATH"
373
-
374
- if [ ! -f $TARBALL_PATH ]; then
375
- echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
376
- exit 0
377
- fi
378
-
379
- echo "Found Hermes tarball at $TARBALL_PATH"
380
- echo "export HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $BASH_ENV
381
- - run :
382
- name : Print Hermes version
383
- command : |
384
- HERMES_TARBALL_ARTIFACTS_DIR=<< parameters.hermes_tarball_artifacts_dir >>
385
- TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
386
- TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
387
- if [[ -e $TARBALL_PATH ]]; then
388
- tar -xf $TARBALL_PATH
389
- echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
390
- ./destroot/bin/hermes test.js
391
- rm test.js
392
- rm -rf destroot
393
- else
394
- echo 'No Hermes tarball found.'
395
- fi
396
- - steps : << parameters.steps >>
397
- - when :
398
- condition :
399
- equal : [ << parameters.flavor >>, "Debug"]
400
- steps :
401
- - save_cache :
402
- key : *hermes_tarball_debug_cache_key
403
- paths : *hermes_tarball_cache_paths
404
- - when :
405
- condition :
406
- equal : [ << parameters.flavor >>, "Release"]
407
- steps :
408
- - save_cache :
409
- key : *hermes_tarball_release_cache_key
410
- paths : *hermes_tarball_cache_paths
411
-
412
- with_hermesc_span :
413
- description : " Makes hermesc available to the provided steps, if hermesc is present."
249
+ with_hermes_sdk_cache_span :
414
250
parameters :
415
251
steps :
416
252
type : steps
@@ -782,12 +618,7 @@ jobs:
782
618
command : ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS
783
619
no_output_timeout : 30m
784
620
785
- - store_test_results :
786
- path : ~/react-native/ReactAndroid/build/test-results
787
-
788
- - store_test_results :
789
- path : ~/react-native/packages/react-native-gradle-plugin/build/test-results
790
-
621
+ # Build JavaScript Bundle for instrumentation tests
791
622
- run :
792
623
name : Build JavaScript Bundle
793
624
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
@@ -1124,18 +955,17 @@ jobs:
1124
955
docker :
1125
956
- image : debian:bullseye
1126
957
resource_class : " xlarge"
958
+ working_directory : /root
1127
959
steps :
1128
- - checkout_code_with_cache
1129
960
- run :
1130
961
name : Install dependencies
1131
962
command : |
1132
963
apt update
1133
964
apt install -y git openssh-client cmake build-essential \
1134
- libreadline-dev libicu-dev jq zip python3
965
+ libreadline-dev libicu-dev zip python3
1135
966
- *attach_hermes_workspace
1136
- - get_react_native_version
1137
967
- restore_cache :
1138
- key : *hermes_linux_cache_key
968
+ key : v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
1139
969
- run :
1140
970
name : Set up workspace
1141
971
command : |
@@ -1154,7 +984,7 @@ jobs:
1154
984
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
1155
985
fi
1156
986
- save_cache :
1157
- key : *hermes_linux_cache_key
987
+ key : v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
1158
988
paths :
1159
989
- /tmp/hermes/linux64-bin/
1160
990
- /tmp/hermes/hermes/destroot/
@@ -1235,9 +1065,7 @@ jobs:
1235
1065
- MSBUILD_DIR : ' C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
1236
1066
- CMAKE_DIR : ' C:\Program Files\CMake\bin'
1237
1067
steps :
1238
- - checkout_code_with_cache
1239
1068
- *attach_hermes_workspace
1240
- - get_react_native_version_windows
1241
1069
- restore_cache :
1242
1070
key : v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
1243
1071
- run :
0 commit comments