Skip to content

Commit c16e55c

Browse files
authored
Merge branch 'main' into feat/eslint-flat-config
2 parents d53f664 + 3f17c8b commit c16e55c

File tree

1,370 files changed

+51723
-20167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,370 files changed

+51723
-20167
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ SpacesInSquareBrackets: false
8484
Standard: Cpp11
8585
TabWidth: 8
8686
UseTab: Never
87+
QualifierAlignment: Left
8788
---
8889
Language: ObjC
8990
ColumnLimit: 120

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = {
2424
// overriding the JS config from @react-native/eslint-config to ensure
2525
// that we use hermes-eslint for all js files
2626
{
27-
files: ['*.js', '*.js.flow'],
27+
files: ['*.js', '*.js.flow', '*.jsx'],
2828
parser: 'hermes-eslint',
2929
rules: {
3030
// These rules are not required with hermes-eslint

.flowconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[ignore]
22
; Ignore templates for 'react-native init'
33
<PROJECT_ROOT>/packages/react-native/template/.*
4+
<PROJECT_ROOT>/packages/react-native/sdks/.*
45

56
; Ignore the Dangerfile
67
<PROJECT_ROOT>/packages/react-native-bots/dangerfile.js
@@ -34,7 +35,6 @@ packages/react-native/interface.js
3435
packages/react-native/flow/
3536

3637
[options]
37-
experimental.global_find_ref=true
3838
enums=true
3939
casting_syntax=both
4040

@@ -85,4 +85,4 @@ untyped-import
8585
untyped-type-import
8686

8787
[version]
88-
^0.232.0
88+
^0.236.0
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: cache_setup
2+
description: "Cache setup"
3+
inputs:
4+
hermes-version:
5+
description: "Hermes version"
6+
required: true
7+
react-native-version:
8+
description: "React Native version"
9+
required: true
10+
outputs:
11+
cache-hit-hermes-tarball-release:
12+
description: "Whether the hermes tarball release cache was hit"
13+
value: ${{ steps.cache_hermes_tarball_release.outputs.cache-hit }}
14+
cache-hit-hermes-tarball-debug:
15+
description: "Whether the hermes tarball debug cache was hit"
16+
value: ${{ steps.cache_hermes_tarball_debug.outputs.cache-hit }}
17+
cache-hit-macos-bin-release:
18+
description: "Whether the macos bin release cache was hit"
19+
value: ${{ steps.cache_macos_bin_release.outputs.cache-hit }}
20+
cache-hit-macos-bin-debug:
21+
description: "Whether the macos bin debug cache was hit"
22+
value: ${{ steps.cache_macos_bin_debug.outputs.cache-hit }}
23+
cache-hit-dsym-release:
24+
description: "Whether the dsym release cache was hit"
25+
value: ${{ steps.cache_dsym_release.outputs.cache-hit }}
26+
cache-hit-dsym-debug:
27+
description: "Whether the dsym debug cache was hit"
28+
value: ${{ steps.cache_dsym_debug.outputs.cache-hit }}
29+
runs:
30+
using: composite
31+
steps:
32+
- name: Cache hermes tarball release
33+
id: cache_hermes_tarball_release
34+
uses: actions/[email protected]
35+
with:
36+
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Release.tar.gz
37+
key: v4-hermes-tarball-release-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
38+
enableCrossOsArchive: true
39+
- name: Cache hermes tarball debug
40+
id: cache_hermes_tarball_debug
41+
uses: actions/[email protected]
42+
with:
43+
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-Debug.tar.gz
44+
key: v4-hermes-tarball-debug-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
45+
enableCrossOsArchive: true
46+
- name: Cache macos bin release
47+
id: cache_macos_bin_release
48+
uses: actions/[email protected]
49+
with:
50+
path: /tmp/hermes/osx-bin/Release
51+
key: v2-hermes-release-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
52+
enableCrossOsArchive: true
53+
- name: Cache macos bin debug
54+
id: cache_macos_bin_debug
55+
uses: actions/[email protected]
56+
with:
57+
path: /tmp/hermes/osx-bin/Debug
58+
key: v2-hermes-debug-macosx-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
59+
enableCrossOsArchive: true
60+
- name: Cache dsym release
61+
id: cache_dsym_release
62+
uses: actions/[email protected]
63+
with:
64+
path: /tmp/hermes/dSYM/Release
65+
key: v2-hermes-release-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
66+
enableCrossOsArchive: true
67+
- name: Cache dsym debug
68+
id: cache_dsym_debug
69+
uses: actions/[email protected]
70+
with:
71+
path: /tmp/hermes/dSYM/Debug
72+
key: v2-hermes-debug-dsym-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
73+
enableCrossOsArchive: true
74+
- name: HermesC Apple
75+
id: hermesc_apple
76+
uses: actions/[email protected]
77+
with:
78+
path: /tmp/hermes/hermesc-apple
79+
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
80+
enableCrossOsArchive: true
81+
- name: Cache hermes workspace
82+
uses: actions/[email protected]
83+
with:
84+
path: |
85+
/tmp/hermes/download/
86+
/tmp/hermes/hermes/
87+
key: v1-hermes-${{ inputs.hermes-version }}-${{ github.run_number }}
88+
enableCrossOsArchive: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Setup xcode
2+
description: 'Set up your GitHub Actions workflow with a specific version of xcode'
3+
inputs:
4+
xcode-version:
5+
description: 'The xcode version to use'
6+
required: false
7+
default: '15.2'
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Setup xcode
12+
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
13+
with:
14+
xcode-version: ${{ inputs.xcode-version }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: setup_hermes_workspace
2+
description: "Setup hermes workspace"
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Set up workspace
7+
shell: bash
8+
run: |
9+
mkdir -p $HERMES_OSXBIN_ARTIFACTS_DIR ./packages/react-native/sdks/hermes
10+
cp -r $HERMES_WS_DIR/hermes/* ./packages/react-native/sdks/hermes/.
11+
cp -r ./packages/react-native/sdks/hermes-engine/utils ./packages/react-native/sdks/hermes/.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: setup_xcode_build_cache
2+
description: Add caching to iOS jobs to speed up builds
3+
inputs:
4+
hermes-version:
5+
description: The version of hermes
6+
required: true
7+
runs:
8+
using: composite
9+
steps:
10+
- name: See commands.yml with_xcodebuild_cache
11+
shell: bash
12+
run: echo "See commands.yml with_xcodebuild_cache"
13+
- name: Prepare Xcodebuild cache
14+
shell: bash
15+
run: |
16+
WEEK=$(date +"%U")
17+
YEAR=$(date +"%Y")
18+
echo "$WEEK-$YEAR" > /tmp/week_year
19+
- name: Cache podfile lock
20+
uses: actions/[email protected]
21+
with:
22+
path: packages/rn-tester/Podfile.lock
23+
key: v9-podfilelock-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile') }}-{{ hashfiles('/tmp/week_year') }}-${{ inputs.hermes-version}}
24+
- name: Cache cocoapods
25+
uses: actions/[email protected]
26+
with:
27+
path: packages/rn-tester/Pods
28+
key: v11-cocoapods-${{ github.job }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-{{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: test_ios_rntester
2+
description: Test iOS RNTester
3+
inputs:
4+
jsengine:
5+
description: Which JavaScript engine to use. Must be one of "Hermes", "JSC".
6+
default: Hermes
7+
use-frameworks:
8+
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
9+
default: StaticLibraries
10+
architecture:
11+
description: The React Native architecture to Test. RNTester has always Fabric enabled, but we want to run integration test with the old arch setup
12+
default: NewArch
13+
ruby-version:
14+
description: The version of ruby that must be used
15+
default: 2.6.10
16+
run-unit-tests:
17+
description: whether unit tests should run or not.
18+
default: false
19+
hermes-tarball-artifacts-dir:
20+
description: The directory where the hermes tarball artifacts are stored
21+
default: /tmp/hermes/hermes-runtime-darwin
22+
flavor:
23+
description: The flavor of the build. Must be one of "Debug", "Release".
24+
default: Debug
25+
hermes-version:
26+
description: The version of hermes
27+
required: true
28+
react-native-version:
29+
description: The version of react-native
30+
required: true
31+
runs:
32+
using: composite
33+
steps:
34+
- name: Setup xcode
35+
uses: ./.github/actions/setup-xcode
36+
- name: Setup node.js
37+
uses: ./.github/actions/setup-node
38+
- name: Run yarn
39+
shell: bash
40+
run: yarn install --non-interactive
41+
- name: Cache setup
42+
id: cache_setup
43+
uses: ./.github/actions/cache_setup
44+
with:
45+
hermes-version: ${{ inputs.hermes-version }}
46+
react-native-version: ${{ inputs.react-native-version }}
47+
- name: Setup ruby
48+
uses: ruby/[email protected]
49+
with:
50+
ruby-version: ${{ inputs.ruby-version }}
51+
- name: Prepare IOS Tests
52+
if: ${{ inputs.run-unit-tests == true }}
53+
uses: ./.github/actions/prepare_ios_tests
54+
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
55+
shell: bash
56+
run: |
57+
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
58+
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
59+
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
60+
exit 0
61+
fi
62+
63+
if [ ! -d ~/react-native ]; then
64+
echo "No React Native checkout found. Run `checkout` first."
65+
exit 0
66+
fi
67+
68+
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
69+
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
70+
71+
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
72+
echo "$TARBALL_PATH"
73+
74+
if [ ! -f $TARBALL_PATH ]; then
75+
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
76+
exit 0
77+
fi
78+
79+
echo "Found Hermes tarball at $TARBALL_PATH"
80+
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
81+
- name: Print Hermes version
82+
shell: bash
83+
run: |
84+
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
85+
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
86+
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
87+
if [[ -e $TARBALL_PATH ]]; then
88+
tar -xf $TARBALL_PATH
89+
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
90+
./destroot/bin/hermes test.js
91+
rm test.js
92+
rm -rf destroot
93+
else
94+
echo 'No Hermes tarball found.'
95+
fi
96+
- name: Setup xcode build cache
97+
uses: ./.github/actions/setup_xcode_build_cache
98+
with:
99+
hermes-version: ${{ inputs.hermes-version }}
100+
- name: Install CocoaPods dependencies
101+
shell: bash
102+
run: |
103+
if [[ ${{ inputs.jsengine }} == "JSC" ]]; then
104+
export USE_HERMES=0
105+
fi
106+
107+
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
108+
export USE_FRAMEWORKS=dynamic
109+
fi
110+
111+
if [[ ${{ inputs.architecture }} == "NewArch" ]]; then
112+
export RCT_NEW_ARCH_ENABLED=1
113+
fi
114+
115+
cd packages/rn-tester
116+
117+
bundle install
118+
bundle exec pod install
119+
- name: Build RNTester
120+
if: ${{ inputs.run-unit-tests != true }}
121+
shell: bash
122+
run: |
123+
xcodebuild build \
124+
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
125+
-scheme RNTester \
126+
-sdk iphonesimulator
127+
- name: "Run Tests: iOS Unit and Integration Tests"
128+
if: ${{ inputs.run-unit-tests == true }}
129+
shell: bash
130+
run: node ./scripts/circleci/run_with_retry.js 3 yarn test-ios
131+
- name: Zip Derived data folder
132+
if: ${{ inputs.run-unit-tests == true }}
133+
shell: bash
134+
run: |
135+
echo "zipping tests results"
136+
cd /Users/distiller/Library/Developer/Xcode
137+
XCRESULT_PATH=$(find . -name '*.xcresult')
138+
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
139+
- name: Upload artifact
140+
uses: actions/[email protected]
141+
if: ${{ inputs.run-unit-tests == true }}
142+
with:
143+
name: xcresults
144+
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz
145+
- name: Report bundle size
146+
if: ${{ inputs.run-unit-tests == true }}
147+
uses: ./.github/actions/report_bundle_size
148+
with:
149+
platform: ios
150+
- name: Store test results
151+
if: ${{ inputs.run-unit-tests == true }}
152+
uses: actions/[email protected]
153+
with:
154+
name: test-results
155+
path: ./reports/junit

0 commit comments

Comments
 (0)