forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:mateoguzmana/react-native into re…
…factor/migrate-header-util-to-kotlin
- Loading branch information
Showing
1,114 changed files
with
119,315 additions
and
89,450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,17 @@ inputs: | |
required: false | ||
default: "." | ||
description: The directory from which metro should be started | ||
architecture: | ||
required: false | ||
default: "NewArch" | ||
description: The react native architecture to test | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Installing Maestro | ||
shell: bash | ||
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash | ||
run: export MAESTRO_VERSION=1.39.5; curl -Ls "https://get.maestro.mobile.dev" | bash | ||
- name: Set up JDK 17 | ||
if: ${{ inputs.install-java == 'true' }} | ||
uses: actions/setup-java@v4 | ||
|
@@ -52,12 +56,15 @@ runs: | |
if: ${{ inputs.flavor == 'debug' }} | ||
run: ./packages/react-native-codegen/scripts/oss/build.sh | ||
- name: Run e2e tests | ||
id: run-tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: 24 | ||
arch: x86 | ||
ram-size: '4096M' | ||
ram-size: '8192M' | ||
heap-size: '4096M' | ||
disk-size: '10G' | ||
cores: '4' | ||
disable-animations: false | ||
avd-name: e2e_emulator | ||
script: node .github/workflow-scripts/maestro-android.js ${{ inputs.app-path }} ${{ inputs.app-id }} ${{ inputs.maestro-flow }} ${{ inputs.flavor }} ${{ inputs.working-directory }} | ||
|
@@ -69,16 +76,16 @@ runs: | |
NORM_APP_ID=$(echo "${{ inputs.app-id }}" | tr '.' '-') | ||
echo "app-id=$NORM_APP_ID" >> $GITHUB_OUTPUT | ||
- name: Store tests result | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4.3.4 | ||
if: always() | ||
with: | ||
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }} | ||
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }} | ||
path: | | ||
report.xml | ||
screen.mp4 | ||
- name: Store Logs | ||
if: failure() && steps.run-tests.outcome == 'failure' | ||
if: steps.run-tests.outcome == 'failure' | ||
uses: actions/[email protected] | ||
with: | ||
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }} | ||
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }} | ||
path: /tmp/MaestroLogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,18 +21,22 @@ inputs: | |
required: false | ||
default: "." | ||
description: The directory from which metro should be started | ||
architecture: | ||
required: false | ||
default: "NewArch" | ||
description: The react native architecture to test | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Installing Maestro | ||
shell: bash | ||
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash | ||
run: export MAESTRO_VERSION=1.39.5; curl -Ls "https://get.maestro.mobile.dev" | bash | ||
- name: Installing Maestro dependencies | ||
shell: bash | ||
run: | | ||
brew tap facebook/fb | ||
brew install facebook/fb/idb-companion jq | ||
brew install facebook/fb/idb-companion | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
|
@@ -42,6 +46,11 @@ runs: | |
shell: bash | ||
if: ${{ inputs.flavor == 'Debug' }} | ||
run: | | ||
yarn install | ||
# build codegen or we will see a redbox | ||
./packages/react-native-codegen/scripts/oss/build.sh | ||
cd ${{ inputs.working-directory }} | ||
yarn start & | ||
sleep 5 # to give metro time to load | ||
|
@@ -53,69 +62,28 @@ runs: | |
# Maestro can fail in case of flakyness, we have some retry logic. | ||
set +e | ||
echo "Launching iOS Simulator: iPhone 15 Pro" | ||
xcrun simctl boot "iPhone 15 Pro" | ||
echo "Installing app on Simulator" | ||
xcrun simctl install booted "${{ inputs.app-path }}" | ||
echo "Retrieving device UDID" | ||
UDID=$(xcrun simctl list devices booted -j | jq -r '[.devices[]] | add | first | .udid') | ||
echo "UDID is $UDID" | ||
echo "Bring simulator in foreground" | ||
open -a simulator | ||
echo "Launch the app" | ||
xcrun simctl launch $UDID ${{ inputs.app-id }} | ||
if [[ ${{ inputs.flavor }} == 'Debug' ]]; then | ||
# To give the app time to warm the metro's cache | ||
sleep 20 | ||
fi | ||
echo "Running tests with Maestro" | ||
export MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 # 25 min. CI is extremely slow | ||
# Add retries for flakyness | ||
MAX_ATTEMPTS=5 | ||
CURR_ATTEMPT=0 | ||
RESULT=1 | ||
while [[ $CURR_ATTEMPT -lt $MAX_ATTEMPTS ]] && [[ $RESULT -ne 0 ]]; do | ||
CURR_ATTEMPT=$((CURR_ATTEMPT+1)) | ||
echo "Attempt number $CURR_ATTEMPT" | ||
echo "Start video record using pid: video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid" | ||
xcrun simctl io booted recordVideo video_record_$CURR_ATTEMPT.mov & echo $! > video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid | ||
echo '$HOME/.maestro/bin/maestro --udid=$UDID test ${{ inputs.maestro-flow }} --format junit -e APP_ID=${{ inputs.app-id }}' | ||
$HOME/.maestro/bin/maestro --udid=$UDID test ${{ inputs.maestro-flow }} --format junit -e APP_ID=${{ inputs.app-id }} --debug-output /tmp/MaestroLogs | ||
RESULT=$? | ||
# Stop video | ||
kill -SIGINT $(cat video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid) | ||
done | ||
exit $RESULT | ||
node .github/workflow-scripts/maestro-ios.js \ | ||
"${{ inputs.app-path }}" \ | ||
"${{ inputs.app-id }}" \ | ||
"${{ inputs.maestro-flow }}" \ | ||
"${{ inputs.jsengine }}" \ | ||
"${{ inputs.flavor }}" \ | ||
"${{ inputs.working-directory }}" | ||
- name: Store video record | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }} | ||
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}_${{ inputs.architecture }} | ||
path: | | ||
video_record_1.mov | ||
video_record_2.mov | ||
video_record_3.mov | ||
video_record_4.mov | ||
video_record_5.mov | ||
video_record_${{ inputs.jsengine }}_1.mov | ||
video_record_${{ inputs.jsengine }}_2.mov | ||
video_record_${{ inputs.jsengine }}_3.mov | ||
video_record_${{ inputs.jsengine }}_4.mov | ||
video_record_${{ inputs.jsengine }}_5.mov | ||
report.xml | ||
- name: Store Logs | ||
if: failure() && steps.run-tests.outcome == 'failure' | ||
uses: actions/[email protected] | ||
with: | ||
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }} | ||
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}-${{ inputs.architecture }} | ||
path: /tmp/MaestroLogs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ runs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: yarn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ runs: | |
shell: bash | ||
run: ls -lR "$HERMES_WS_DIR" | ||
- name: Run yarn | ||
uses: ./.github/actions/yarn-install-with-cache | ||
uses: ./.github/actions/yarn-install | ||
- name: Setup ruby | ||
uses: ruby/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ runs: | |
- name: Setup node.js | ||
uses: ./.github/actions/setup-node | ||
- name: Run yarn | ||
uses: ./.github/actions/yarn-install-with-cache | ||
uses: ./.github/actions/yarn-install | ||
- name: Download Hermes | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -109,25 +109,16 @@ runs: | |
export USE_FRAMEWORKS=dynamic | ||
fi | ||
if [[ ${{ inputs.architecture }} == "NewArch" ]]; then | ||
export RCT_NEW_ARCH_ENABLED=1 | ||
if [[ ${{ inputs.architecture }} == "OldArch" ]]; then | ||
export RCT_NEW_ARCH_ENABLED=0 | ||
fi | ||
cd packages/rn-tester | ||
bundle install | ||
bundle exec pod install | ||
- name: Build RNTester | ||
if: ${{ inputs.run-unit-tests != 'true' && inputs.run-e2e-tests == 'false' }} | ||
shell: bash | ||
run: | | ||
xcodebuild build \ | ||
-workspace packages/rn-tester/RNTesterPods.xcworkspace \ | ||
-scheme RNTester \ | ||
-sdk iphonesimulator | ||
- name: Build RNTester (E2E Tests) | ||
shell: bash | ||
if: ${{ inputs.run-e2e-tests == 'true' }} | ||
run: | | ||
xcodebuild \ | ||
-scheme "RNTester" \ | ||
|
@@ -138,7 +129,10 @@ runs: | |
-derivedDataPath "/tmp/RNTesterBuild" | ||
echo "Print path to *.app file" | ||
find "/tmp/RNTesterBuild" -type d -name "*.app" | ||
APP_PATH=$(find "/tmp/RNTesterBuild" -type d -name "*.app") | ||
echo "App found at $APP_PATH" | ||
echo "app-path=$APP_PATH" >> $GITHUB_ENV | ||
- name: "Run Tests: iOS Unit and Integration Tests" | ||
if: ${{ inputs.run-unit-tests == 'true' }} | ||
shell: bash | ||
|
@@ -158,6 +152,12 @@ runs: | |
with: | ||
name: xcresults | ||
path: /Users/distiller/Library/Developer/Xcode/xcresults.tar.gz | ||
- name: Upload RNTester App | ||
if: ${{ inputs.use-frameworks == 'StaticLibraries' && inputs.ruby-version == '2.6.10' }} # This is needed to avoid conflicts with the artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: RNTesterApp-${{ inputs.architecture }}-${{ inputs.jsengine }}-${{ inputs.flavor }} | ||
path: ${{ env.app-path }} | ||
- name: Store test results | ||
if: ${{ inputs.run-unit-tests == 'true' }} | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: yarn-install | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install dependencies | ||
shell: bash | ||
run: yarn install --non-interactive --frozen-lockfile |
Oops, something went wrong.