Skip to content

Commit a5ae7b8

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Connect ReactNativeDependencies with ios jobs (#49978)
Summary: Pull Request resolved: #49978 This change connects the RNDependencies we prebuild in CI with the other iOS jobs we have. By doing so, we aim to speed up the build time in CI, saving time and money. ## Changelog: [Internal] - Connect the ReactNativeDependencies in CI Differential Revision: D71034587
1 parent 4157681 commit a5ae7b8

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

.github/actions/test-ios-helloworld/action.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ runs:
4646
uses: ruby/[email protected]
4747
with:
4848
ruby-version: ${{ inputs.ruby-version }}
49+
- name: Download ReactNativeDependencies
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: ReactNativeDependencies${{ inputs.flavor }}.framework.dSYM.tar.gz
53+
path: packages/react-native/third-party
54+
- name: Print third-party folder
55+
shell: bash
56+
run: ls -lR packages/react-native/third-party
4957
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }}; New Architecture ${{ inputs.architecture }}; JS Engine ${{ inputs.jsengine }}
5058
shell: bash
5159
run: |
@@ -78,7 +86,8 @@ runs:
7886
BUILD_TYPE="${{ inputs.flavor }}"
7987
TARBALL_FILENAME=$(node ../react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
8088
HERMES_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
81-
HERMES_ENGINE_TARBALL_PATH="$HERMES_PATH" yarn bootstrap ios "${args[@]}" | cat
89+
RN_DEP_PATH=packages/react-native/third-party/ReactNativeDependencies${{ inputs.flavor }}.framework.dSYM.tar.gz
90+
RCT_USE_LOCAL_RN_DEP="$RN_DEP_PATH" HERMES_ENGINE_TARBALL_PATH="$HERMES_PATH" yarn bootstrap ios "${args[@]}" | cat
8291
fi
8392
- name: Build HelloWorld project
8493
shell: bash

.github/actions/test-ios-rntester/action.yml

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ runs:
9292
else
9393
echo 'No Hermes tarball found.'
9494
fi
95+
- name: Download ReactNativeDependencies
96+
uses: actions/download-artifact@v4
97+
with:
98+
name: ReactNativeDependencies${{ inputs.flavor }}.framework.dSYM.tar.gz
99+
path: packages/react-native/third-party
100+
- name: Print third-party folder
101+
shell: bash
102+
run: ls -lR packages/react-native/third-party
95103
- name: Setup xcode build cache
96104
uses: ./.github/actions/setup-xcode-build-cache
97105
with:
@@ -118,6 +126,8 @@ runs:
118126
export RCT_NEW_ARCH_ENABLED=0
119127
fi
120128
129+
export RCT_USE_LOCAL_RN_DEP=packages/react-native/third-party/ReactNativeDependencies${{ inputs.flavor }}.framework.dSYM.tar.gz
130+
121131
cd packages/rn-tester
122132
123133
bundle install

.github/workflows/test-all.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
test_ios_rntester_ruby_3_2_0:
124124
runs-on: macos-13
125125
needs:
126-
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
126+
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
127127
env:
128128
HERMES_WS_DIR: /tmp/hermes
129129
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
@@ -140,7 +140,7 @@ jobs:
140140
test_ios_rntester_dynamic_frameworks:
141141
runs-on: macos-13
142142
needs:
143-
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
143+
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
144144
env:
145145
HERMES_WS_DIR: /tmp/hermes
146146
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
@@ -163,7 +163,7 @@ jobs:
163163
test_ios_rntester:
164164
runs-on: macos-13-large
165165
needs:
166-
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
166+
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
167167
env:
168168
HERMES_WS_DIR: /tmp/hermes
169169
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
@@ -232,7 +232,7 @@ jobs:
232232
test_e2e_ios_templateapp:
233233
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
234234
runs-on: macos-13-large
235-
needs: build_npm_package
235+
needs: [build_npm_package, prebuild_apple_dependencies]
236236
env:
237237
HERMES_WS_DIR: /tmp/hermes
238238
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
@@ -268,6 +268,14 @@ jobs:
268268
path: /tmp/react-native-tmp
269269
- name: Print /tmp folder
270270
run: ls -lR /tmp/react-native-tmp
271+
- name: Download ReactNativeDependencies
272+
uses: actions/download-artifact@v4
273+
with:
274+
name: ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
275+
path: /tmp/third-party
276+
- name: Print third-party folder
277+
shell: bash
278+
run: ls -lR /tmp/third-party
271279
- name: Prepare artifacts
272280
run: |
273281
REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz")
@@ -292,7 +300,9 @@ jobs:
292300
echo "Disable the New Architecture"
293301
NEW_ARCH_ENABLED=0
294302
fi
295-
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
303+
304+
LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
305+
RCT_USE_LOCAL_RN_DEP="$LOCAL_RN_DEP" HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
296306
297307
xcodebuild \
298308
-scheme "RNTestProject" \
@@ -580,7 +590,7 @@ jobs:
580590

581591
test_ios_helloworld_with_ruby_3_2_0:
582592
runs-on: macos-13
583-
needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
593+
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
584594
env:
585595
PROJECT_NAME: iOSTemplateProject
586596
HERMES_WS_DIR: /tmp/hermes
@@ -598,7 +608,7 @@ jobs:
598608

599609
test_ios_helloworld:
600610
runs-on: macos-13
601-
needs: [prepare_hermes_workspace, build_hermes_macos] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
611+
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
602612
strategy:
603613
matrix:
604614
flavor: [Debug, Release]

0 commit comments

Comments
 (0)