Skip to content

Commit 0cfdcb0

Browse files
author
Riccardo Cipolleschi
committedJun 8, 2023
[LOCAL] Manually port back the version dependent hermesc for linux and windows
1 parent 4906002 commit 0cfdcb0

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed
 

‎.circleci/config.yml

+38-5
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,29 @@ commands:
268268
- sdks/hermesc
269269
- sdks/hermes
270270

271+
get_react_native_version:
272+
steps:
273+
- run:
274+
name: Get React Native version
275+
command: |
276+
VERSION=$(cat package.json | jq -r '.version')
277+
# Save the react native version we are building in a file so we can use that file as part of the cache key.
278+
echo "$VERSION" > /tmp/react-native-version
279+
echo "React Native Version is $(cat /tmp/react-native-version)"
280+
HERMES_VERSION="$(cat /tmp/hermes/hermesversion)"
281+
echo "Hermes commit is $HERMES_VERSION"
282+
get_react_native_version_windows:
283+
steps:
284+
- run:
285+
name: Get React Native version on Windows
286+
command: |
287+
$VERSION=cat packages/react-native/package.json | jq -r '.version'
288+
# Save the react native version we are building in a file so we can use that file as part of the cache key.
289+
echo "$VERSION" > /tmp/react-native-version
290+
echo "React Native Version is $(cat /tmp/react-native-version)"
291+
$HERMES_VERSION=cat C:\Users\circleci\project\tmp\hermes\hermesversion
292+
echo "Hermes commit is $HERMES_VERSION"
293+
271294
# -------------------------
272295
# JOBS
273296
# -------------------------
@@ -618,6 +641,12 @@ jobs:
618641
command: ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=$BUILD_THREADS
619642
no_output_timeout: 30m
620643

644+
- store_test_results:
645+
path: ~/react-native/ReactAndroid/build/test-results
646+
647+
- store_test_results:
648+
path: ~/react-native/packages/react-native-gradle-plugin/build/test-results
649+
621650
# Build JavaScript Bundle for instrumentation tests
622651
- run:
623652
name: Build JavaScript Bundle
@@ -957,15 +986,17 @@ jobs:
957986
resource_class: "xlarge"
958987
working_directory: /root
959988
steps:
989+
- checkout
960990
- run:
961991
name: Install dependencies
962992
command: |
963993
apt update
964994
apt install -y git openssh-client cmake build-essential \
965-
libreadline-dev libicu-dev zip python3
995+
libreadline-dev libicu-dev zip jq python3
966996
- *attach_hermes_workspace
997+
- get_react_native_version
967998
- restore_cache:
968-
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
999+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
9691000
- run:
9701001
name: Set up workspace
9711002
command: |
@@ -984,7 +1015,7 @@ jobs:
9841015
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
9851016
fi
9861017
- save_cache:
987-
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/hermes/hermesversion" }}
1018+
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-linux-{{ checksum "/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
9881019
paths:
9891020
- /tmp/hermes/linux64-bin/
9901021
- /tmp/hermes/hermes/destroot/
@@ -1065,9 +1096,11 @@ jobs:
10651096
- MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
10661097
- CMAKE_DIR: 'C:\Program Files\CMake\bin'
10671098
steps:
1099+
- checkout
10681100
- *attach_hermes_workspace
1101+
- get_react_native_version_windows
10691102
- restore_cache:
1070-
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
1103+
key: v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
10711104
- run:
10721105
name: Set up workspace
10731106
command: |
@@ -1117,7 +1150,7 @@ jobs:
11171150
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
11181151
}
11191152
- save_cache:
1120-
key: v1-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
1153+
key: v2-hermes-{{ .Environment.CIRCLE_JOB }}-windows-{{ checksum "/Users/circleci/project/tmp/hermes/hermesversion" }}-{{ checksum "/tmp/react-native-version" }}
11211154
paths:
11221155
- C:\tmp\hermes\win64-bin\
11231156
- C:\tmp\hermes\hermes\icu\

0 commit comments

Comments
 (0)
Please sign in to comment.