From 70161c94a0ca344b6607fce5d958293e2158d86b Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 09:43:41 +0200 Subject: [PATCH 01/31] First attempt --- install-tests/react-native/README.md | 14 ++++++++++++ install-tests/react-native/cli.ts | 22 +++++-------------- .../patches/ccache-Podfile-pre-73.patch | 18 +++++++++++++++ .../react-native/patches/ccache-Podfile.patch | 8 +++---- .../react-native/patches/jsc-Podfile.patch | 10 --------- .../patches/jsc-build.gradle.patch | 11 ---------- 6 files changed, 42 insertions(+), 41 deletions(-) create mode 100644 install-tests/react-native/README.md create mode 100644 install-tests/react-native/patches/ccache-Podfile-pre-73.patch delete mode 100644 install-tests/react-native/patches/jsc-Podfile.patch delete mode 100644 install-tests/react-native/patches/jsc-build.gradle.patch diff --git a/install-tests/react-native/README.md b/install-tests/react-native/README.md new file mode 100644 index 0000000000..bff04f352c --- /dev/null +++ b/install-tests/react-native/README.md @@ -0,0 +1,14 @@ +# How to use + +`npm install` + +`npm run cli` + + +There are two commands for the cli tool: +`init` and `test` + + +`npm run cli init -- --react-native-version next --realm-version latest` + +ran into issues using `bundle` to run pod install and so. Not looking into this right now diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index b4655c29f8..2b8ae26059 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -31,8 +31,7 @@ const DEFAULT_APP_PATH = path.resolve(__dirname, "app"); const PATCHES_PATH = path.resolve(__dirname, "patches"); const APP_JS_PATH = path.resolve(PATCHES_PATH, "App.js"); const CCACHE_PODFILE_PATCH_PATH = path.resolve(PATCHES_PATH, "ccache-Podfile.patch"); -const JSC_PODFILE_PATCH_PATH = path.resolve(PATCHES_PATH, "jsc-Podfile.patch"); -const JSC_BUILD_GRADLE_PATCH_PATH = path.resolve(PATCHES_PATH, "jsc-build.gradle.patch"); +const CCACHE_PODFILE_PATCH_PATH_PRE_73 = path.resolve(PATCHES_PATH, "ccache-Podfile-pre-73.patch"); const PORT = 3000; const TIMEOUT = 5 * 60 * 1000; // 5 min should be plenty of time from app has launched until message gets received @@ -160,26 +159,17 @@ yargs(hideBin(process.argv)) // We're using force to succeed on peer dependency issues exec("npm", ["install", `realm@${realmVersion}`, "--force"], { cwd: appPath }); - const podfilePath = path.resolve(appPath, "ios", "Podfile"); - console.log(`Patching podfile to use ccache (${podfilePath})`); - applyPatch(CCACHE_PODFILE_PATCH_PATH, podfilePath); - const { version: resolvedReactNativeVersion } = readPackageJson( path.resolve(appPath, "node_modules/react-native"), ); - // TODO: Delete this once 0.71.0 or above is latest - if (semver.satisfies(resolvedReactNativeVersion, "<0.71.0")) { - if (engine === "jsc") { - console.log(`Patching Podfile to use JSC (${podfilePath})`); - applyPatch(JSC_PODFILE_PATCH_PATH, podfilePath); + const podfilePath = path.resolve(appPath, "ios", "Podfile"); + console.log(`Patching podfile to use ccache (${podfilePath})`); - const appGradleBuildPath = path.resolve(appPath, "android", "app", "build.gradle"); - console.log(`Patching app/build.gradle to use JSC (${appGradleBuildPath})`); - applyPatch(JSC_BUILD_GRADLE_PATCH_PATH, appGradleBuildPath); - } + if (semver.satisfies(resolvedReactNativeVersion, "<0.73.0")) { + applyPatch(CCACHE_PODFILE_PATCH_PATH_PRE_73, podfilePath); } else { - console.log("Skipping patch of Podfile to use JSC, relying on USE_HERMES env variable instead"); + applyPatch(CCACHE_PODFILE_PATCH_PATH, podfilePath); } // Store Gradle properties for RN >=0.71.0 diff --git a/install-tests/react-native/patches/ccache-Podfile-pre-73.patch b/install-tests/react-native/patches/ccache-Podfile-pre-73.patch new file mode 100644 index 0000000000..b3524bd719 --- /dev/null +++ b/install-tests/react-native/patches/ccache-Podfile-pre-73.patch @@ -0,0 +1,18 @@ +--- app/ios/Podfile ++++ app/ios/Podfile +@@ -39,5 +39,15 @@ + :mac_catalyst_enabled => false + ) + __apply_Xcode_12_5_M1_post_install_workaround(installer) ++ # Using ccache when building ++ installer.pods_project.targets.each do |target| ++ target.build_configurations.each do |config| ++ # Using the un-qualified names means you can swap in different implementations, for example ccache ++ config.build_settings["CC"] = "clang" ++ config.build_settings["LD"] = "clang" ++ config.build_settings["CXX"] = "clang++" ++ config.build_settings["LDPLUSPLUS"] = "clang++" ++ end ++ end + end + end diff --git a/install-tests/react-native/patches/ccache-Podfile.patch b/install-tests/react-native/patches/ccache-Podfile.patch index b3524bd719..ed35f90912 100644 --- a/install-tests/react-native/patches/ccache-Podfile.patch +++ b/install-tests/react-native/patches/ccache-Podfile.patch @@ -1,9 +1,9 @@ ---- app/ios/Podfile -+++ app/ios/Podfile -@@ -39,5 +39,15 @@ +--- Podfile.copy 2023-10-09 15:29:25 ++++ Podfile 2023-10-09 15:29:42 +@@ -51,5 +51,15 @@ + config[:reactNativePath], :mac_catalyst_enabled => false ) - __apply_Xcode_12_5_M1_post_install_workaround(installer) + # Using ccache when building + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| diff --git a/install-tests/react-native/patches/jsc-Podfile.patch b/install-tests/react-native/patches/jsc-Podfile.patch deleted file mode 100644 index 8bb42c2767..0000000000 --- a/install-tests/react-native/patches/jsc-Podfile.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- app/ios/Podfile -+++ app/ios/Podfile -@@ -15,7 +15,7 @@ - # Hermes is now enabled by default. Disable by setting this flag to false. - # Upcoming versions of React Native may rely on get_default_flags(), but - # we make it explicit here to aid in the React Native upgrade process. -- :hermes_enabled => true, -+ :hermes_enabled => false, - :fabric_enabled => flags[:fabric_enabled], - # Enables Flipper. diff --git a/install-tests/react-native/patches/jsc-build.gradle.patch b/install-tests/react-native/patches/jsc-build.gradle.patch deleted file mode 100644 index 8d261df409..0000000000 --- a/install-tests/react-native/patches/jsc-build.gradle.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- app/android/app/build.gradle -+++ app/android/app/build.gradle -@@ -79,7 +79,7 @@ - */ - - project.ext.react = [ -- enableHermes: true, // clean and rebuild if changing -+ enableHermes: false, // clean and rebuild if changing - ] - - apply from: "../../node_modules/react-native/react.gradle" From aca6331d86d63036c0fed52a8576e857f8af423e Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 11:18:48 +0200 Subject: [PATCH 02/31] Patch Gemfile --- .github/workflows/install-test-react-native.yml | 4 ++-- install-tests/react-native/cli.ts | 8 ++++++++ install-tests/react-native/patches/Gemfile.patch | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 install-tests/react-native/patches/Gemfile.patch diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index deeabd3462..2e4d52980a 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -38,8 +38,8 @@ jobs: - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: - # - 14.0.1 - - 13.1 + - 14.2 + #- 13.1 node: # RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15 - 18 diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index 2b8ae26059..b4ea5564c2 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -30,6 +30,7 @@ const __dirname = new URL(".", import.meta.url).pathname; const DEFAULT_APP_PATH = path.resolve(__dirname, "app"); const PATCHES_PATH = path.resolve(__dirname, "patches"); const APP_JS_PATH = path.resolve(PATCHES_PATH, "App.js"); +const GEMFILE_PATCH_PATH = path.resolve(PATCHES_PATH, "Gemfile.patch"); const CCACHE_PODFILE_PATCH_PATH = path.resolve(PATCHES_PATH, "ccache-Podfile.patch"); const CCACHE_PODFILE_PATCH_PATH_PRE_73 = path.resolve(PATCHES_PATH, "ccache-Podfile-pre-73.patch"); const PORT = 3000; @@ -163,6 +164,13 @@ yargs(hideBin(process.argv)) path.resolve(appPath, "node_modules/react-native"), ); + // At the time of development, there was a bug with the latest Cocoapods (https://github.com/CocoaPods/CocoaPods/pull/12082) + // This patch will correct this and can most likely be removed by the time you read this. + const gemfilePath = path.resolve(appPath, "Gemfile"); + console.log(`Patching Gemfile to use pin activesupport to supported version (${gemfilePath})`); + + applyPatch(GEMFILE_PATCH_PATH, gemfilePath); + const podfilePath = path.resolve(appPath, "ios", "Podfile"); console.log(`Patching podfile to use ccache (${podfilePath})`); diff --git a/install-tests/react-native/patches/Gemfile.patch b/install-tests/react-native/patches/Gemfile.patch new file mode 100644 index 0000000000..127bfea8cf --- /dev/null +++ b/install-tests/react-native/patches/Gemfile.patch @@ -0,0 +1,7 @@ +--- Gemfile.orig 2023-10-10 11:04:36 ++++ Gemfile 2023-10-10 11:04:41 +@@ -4,3 +4,4 @@ + ruby ">= 2.6.10" + + gem 'cocoapods', '~> 1.12' ++gem 'activesupport', '~> 7.0', '<= 7.0.8' From 69585ce5dc7f314fb37bbe1a00a0ace68ec3743b Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 12:55:38 +0200 Subject: [PATCH 03/31] Revert Gemfile fix, as this was fixed by meta --- install-tests/react-native/cli.ts | 8 -------- install-tests/react-native/patches/Gemfile.patch | 7 ------- 2 files changed, 15 deletions(-) delete mode 100644 install-tests/react-native/patches/Gemfile.patch diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index b4ea5564c2..2b8ae26059 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -30,7 +30,6 @@ const __dirname = new URL(".", import.meta.url).pathname; const DEFAULT_APP_PATH = path.resolve(__dirname, "app"); const PATCHES_PATH = path.resolve(__dirname, "patches"); const APP_JS_PATH = path.resolve(PATCHES_PATH, "App.js"); -const GEMFILE_PATCH_PATH = path.resolve(PATCHES_PATH, "Gemfile.patch"); const CCACHE_PODFILE_PATCH_PATH = path.resolve(PATCHES_PATH, "ccache-Podfile.patch"); const CCACHE_PODFILE_PATCH_PATH_PRE_73 = path.resolve(PATCHES_PATH, "ccache-Podfile-pre-73.patch"); const PORT = 3000; @@ -164,13 +163,6 @@ yargs(hideBin(process.argv)) path.resolve(appPath, "node_modules/react-native"), ); - // At the time of development, there was a bug with the latest Cocoapods (https://github.com/CocoaPods/CocoaPods/pull/12082) - // This patch will correct this and can most likely be removed by the time you read this. - const gemfilePath = path.resolve(appPath, "Gemfile"); - console.log(`Patching Gemfile to use pin activesupport to supported version (${gemfilePath})`); - - applyPatch(GEMFILE_PATCH_PATH, gemfilePath); - const podfilePath = path.resolve(appPath, "ios", "Podfile"); console.log(`Patching podfile to use ccache (${podfilePath})`); diff --git a/install-tests/react-native/patches/Gemfile.patch b/install-tests/react-native/patches/Gemfile.patch deleted file mode 100644 index 127bfea8cf..0000000000 --- a/install-tests/react-native/patches/Gemfile.patch +++ /dev/null @@ -1,7 +0,0 @@ ---- Gemfile.orig 2023-10-10 11:04:36 -+++ Gemfile 2023-10-10 11:04:41 -@@ -4,3 +4,4 @@ - ruby ">= 2.6.10" - - gem 'cocoapods', '~> 1.12' -+gem 'activesupport', '~> 7.0', '<= 7.0.8' From c2f2c5163f3e9d72cf828b01ff74eeba87e9e907 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 13:29:01 +0200 Subject: [PATCH 04/31] Try to use xcode 15 --- .github/workflows/install-test-react-native.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 2e4d52980a..31c2b41768 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,7 +14,7 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: macos-12 + runs-on: macos-13 timeout-minutes: 120 strategy: fail-fast: false @@ -38,7 +38,7 @@ jobs: - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: - - 14.2 + - 15.0 #- 13.1 node: # RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15 From 58b85f24c925cfd99ede1484dee2a10dce0e8e9c Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 13:41:55 +0200 Subject: [PATCH 05/31] Narrow the workflow and fix dir issue --- .github/workflows/install-test-react-native.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 31c2b41768..6c53f260c9 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -21,20 +21,20 @@ jobs: matrix: platform: - ios - - android + #- android realm-version: - - v11 # Enable if we feel the need + #- v11 # Enable if we feel the need - latest # - next react-native-version: - - latest + #- latest - next # - nightly # Enable if it's not too noizy new-architecture: - - true + #- true - false engine: - - jsc + #- jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: @@ -64,7 +64,7 @@ jobs: # TODO: Remove if this becomes unneeded in the future - name: Invoke the simulator (making subsequent "open -a Simulator" calls work) if: ${{ matrix.platform == 'ios' }} - run: open -a ${{ env.DEVELOPER_DIR }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator + run: open -a /Applications/Xcode_${{ matrix.xcode }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator - name: Install dependencies of the CLI run: npm ci From 46e039ca2d43f18218c1b19f9be3655657e33f55 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 13:41:55 +0200 Subject: [PATCH 06/31] Narrow the workflow and fix dir issue --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 6c53f260c9..8106f2b456 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -38,7 +38,7 @@ jobs: - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: - - 15.0 + - "15.0" #- 13.1 node: # RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15 From f35ae3a57169c86b3dcb840b68bba4d667a93eff Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 13:53:30 +0200 Subject: [PATCH 07/31] Try and skip simulator step --- .github/workflows/install-test-react-native.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 8106f2b456..2bff2216e7 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -62,9 +62,9 @@ jobs: run: ccache --set-config="compiler_check=content" # TODO: Remove if this becomes unneeded in the future - - name: Invoke the simulator (making subsequent "open -a Simulator" calls work) - if: ${{ matrix.platform == 'ios' }} - run: open -a /Applications/Xcode_${{ matrix.xcode }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator + # - name: Invoke the simulator (making subsequent "open -a Simulator" calls work) + # if: ${{ matrix.platform == 'ios' }} + # run: open -a /Applications/Xcode_${{ matrix.xcode }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator - name: Install dependencies of the CLI run: npm ci From 70922a91673fd6f00036794a407d6140da0777af Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 14:09:29 +0200 Subject: [PATCH 08/31] Try and use simulator action instead of command --- .github/workflows/install-test-react-native.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 2bff2216e7..7e80697bef 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -38,13 +38,13 @@ jobs: - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: - - "15.0" + - 15.0 #- 13.1 node: # RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15 - 18 - env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app + # env: + # DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -62,6 +62,9 @@ jobs: run: ccache --set-config="compiler_check=content" # TODO: Remove if this becomes unneeded in the future + - uses: futureware-tech/simulator-action@v2 + with: + model: "iPhone 14" # - name: Invoke the simulator (making subsequent "open -a Simulator" calls work) # if: ${{ matrix.platform == 'ios' }} # run: open -a /Applications/Xcode_${{ matrix.xcode }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator From 788e9aad1f2b9892265274294bf23c5b82410f7c Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 14:46:36 +0200 Subject: [PATCH 09/31] Add and update README to help in the future --- install-tests/react-native/README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/install-tests/react-native/README.md b/install-tests/react-native/README.md index bff04f352c..ab89f42584 100644 --- a/install-tests/react-native/README.md +++ b/install-tests/react-native/README.md @@ -1,14 +1,18 @@ -# How to use - -`npm install` - -`npm run cli` - +# How To Use There are two commands for the cli tool: `init` and `test` +The most common usage is the following: + +`npm run init -- --react-native-version next --realm-version latest` + +This will create the template for latest release candidate of React Native, install the latest publish `realm` package +and patch the install test code necessary for the next step. -`npm run cli init -- --react-native-version next --realm-version latest` +`npm run test -- --platform ios` +`npm run test -- --platform android` -ran into issues using `bundle` to run pod install and so. Not looking into this right now +This will run test for `ios` and `android` respectively. The `init` step is required first (without failures). +This will spawn the app and a server which will be waiting for the application to post a message to. +When the message has been sent, the test will shutdown and return a success code. From 818f425cb4bad56970d1fd50c927af56486688a5 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Tue, 10 Oct 2023 15:55:23 +0200 Subject: [PATCH 10/31] Renable the other tests --- .github/workflows/install-test-react-native.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 7e80697bef..99c7b1c259 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -21,20 +21,20 @@ jobs: matrix: platform: - ios - #- android + - android realm-version: - #- v11 # Enable if we feel the need + - v11 # Enable if we feel the need - latest # - next react-native-version: - #- latest + - latest - next # - nightly # Enable if it's not too noizy new-architecture: - #- true + - true - false engine: - #- jsc + - jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: From b082564e448aea6afdbd2495924fbad332f487af Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 09:52:09 +0200 Subject: [PATCH 11/31] Add process shutdown to test --- install-tests/react-native/cli.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index 2b8ae26059..60362d7f43 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -288,10 +288,14 @@ yargs(hideBin(process.argv)) } } finally { // Kill metro, in silence + console.log("exiting metro..."); metro.removeListener("exit", prematureExitCallback); metro.kill(); + console.log("shuting down server..."); // Stop listening for the app server.close(); + console.log("test complete"); + process.exit(); } }, ) From fe6985c7cd7aca92c314a955b9261e2686318b22 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 09:53:38 +0200 Subject: [PATCH 12/31] Constrain the matrix --- .github/workflows/install-test-react-native.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 99c7b1c259..6f97f8d2cc 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -21,20 +21,20 @@ jobs: matrix: platform: - ios - - android + #- android realm-version: - - v11 # Enable if we feel the need + #- v11 # Enable if we feel the need - latest # - next react-native-version: - - latest + #- latest - next # - nightly # Enable if it's not too noizy new-architecture: - - true + #- true - false engine: - - jsc + #- jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: @@ -63,6 +63,7 @@ jobs: # TODO: Remove if this becomes unneeded in the future - uses: futureware-tech/simulator-action@v2 + if: ${{ matrix.platform == 'ios' }} with: model: "iPhone 14" # - name: Invoke the simulator (making subsequent "open -a Simulator" calls work) From 151d1c11e79fa4efe410fda5816778631839976c Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 10:39:56 +0200 Subject: [PATCH 13/31] Full matrix and M1 runner --- .github/workflows/install-test-react-native.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 6f97f8d2cc..a319e56f6b 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,27 +14,27 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: macos-13 + runs-on: macos-13-xlarge timeout-minutes: 120 strategy: fail-fast: false matrix: platform: - ios - #- android + - android realm-version: - #- v11 # Enable if we feel the need + - v11 # Enable if we feel the need - latest # - next react-native-version: - #- latest + - latest - next # - nightly # Enable if it's not too noizy new-architecture: - #- true + - true - false engine: - #- jsc + - jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: From bc1d6f6411a5778c56129393cf38d961c03b8818 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 10:49:36 +0200 Subject: [PATCH 14/31] Revert larger runner --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index a319e56f6b..f844574768 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,7 +14,7 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: macos-13-xlarge + runs-on: macos-13 timeout-minutes: 120 strategy: fail-fast: false From 572855da1a46a742d61833959389c4ab26078dab Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 10:59:19 +0200 Subject: [PATCH 15/31] Try M1 again and remove ruby step --- .github/workflows/install-test-react-native.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index f844574768..d3092a99c8 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,7 +14,7 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: macos-13 + runs-on: macos-13-xlarge timeout-minutes: 120 strategy: fail-fast: false @@ -78,12 +78,12 @@ jobs: # Using "--skip-pod-install" to ensure it happens after setup-ruby has executed run: npm run init -- --skip-bundle-install --skip-pod-install --realm-version ${{ matrix.realm-version }} --react-native-version ${{ matrix.react-native-version }} --engine ${{ matrix.engine }} --new-architecture ${{ matrix.new-architecture }} - - uses: ruby/setup-ruby@v1 - if: ${{ matrix.platform == 'ios' }} - with: - ruby-version: '3.0' - bundler-cache: true - working-directory: install-tests/react-native/app + # - uses: ruby/setup-ruby@v1 + # if: ${{ matrix.platform == 'ios' }} + # with: + # ruby-version: '3.0' + # bundler-cache: true + # working-directory: install-tests/react-native/app - if: ${{ matrix.platform == 'ios' }} run: pod install From d405c0c13f7d0330c0a3d0e9679d752cae2a02de Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 11:12:29 +0200 Subject: [PATCH 16/31] Constrain matrix to Android only --- .github/workflows/install-test-react-native.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index d3092a99c8..ea03d55ae3 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -20,21 +20,21 @@ jobs: fail-fast: false matrix: platform: - - ios + #- ios - android realm-version: - - v11 # Enable if we feel the need + #- v11 # Enable if we feel the need - latest # - next react-native-version: - - latest + #- latest - next # - nightly # Enable if it's not too noizy new-architecture: - - true + #- true - false engine: - - jsc + #- jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: From 8fed0c558f5dbd8f8f79f2043295e3e2613ab9ce Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 11:17:14 +0200 Subject: [PATCH 17/31] Set runner based on platform --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index ea03d55ae3..4b54775b0b 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,7 +14,7 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: macos-13-xlarge + runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13' }} timeout-minutes: 120 strategy: fail-fast: false From 157acaeb0acb3d07dd87e173daad03c6dd777d5e Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 11:35:26 +0200 Subject: [PATCH 18/31] Upgrade to minimum Java version --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 4b54775b0b..2047118a9c 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -93,7 +93,7 @@ jobs: if: ${{ matrix.platform == 'android' }} with: distribution: 'zulu' - java-version: '11' + java-version: '17' - name: Run test (iOS) if: ${{ matrix.platform == 'ios' }} From 64807cee8aea144a6e7e4f2294b4228c04a57d14 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 12:01:58 +0200 Subject: [PATCH 19/31] Open up the matrix --- .github/workflows/install-test-react-native.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 2047118a9c..2cc1ae86da 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -20,21 +20,21 @@ jobs: fail-fast: false matrix: platform: - #- ios + - ios - android realm-version: #- v11 # Enable if we feel the need - latest - # - next + - next react-native-version: - #- latest + - latest - next # - nightly # Enable if it's not too noizy new-architecture: - #- true + - true - false engine: - #- jsc + - jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: From 592b7dfbd5adfd6167a58861fba2ac00126782de Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 13:06:01 +0200 Subject: [PATCH 20/31] Constrain matrix to android and make simulator less featurefull --- .github/workflows/install-test-react-native.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 2cc1ae86da..ca5a24f0f6 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,27 +14,27 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13' }} + runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13-large' }} timeout-minutes: 120 strategy: fail-fast: false matrix: platform: - - ios + #- ios - android realm-version: #- v11 # Enable if we feel the need - latest - - next + #- next react-native-version: - - latest + #- latest - next # - nightly # Enable if it's not too noizy new-architecture: - - true + #- true - false engine: - - jsc + #- jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: @@ -107,6 +107,8 @@ jobs: api-level: 29 target: google_apis script: npm test -- --platform android + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true working-directory: install-tests/react-native slack-workflow-status: From 23dc80f5b8a345490d5856bbb2f1b541c8c1b4b8 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 13:22:18 +0200 Subject: [PATCH 21/31] Attempt a different version of macos for Android --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index ca5a24f0f6..3274407556 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,7 +14,7 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13-large' }} + runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-12-large' }} timeout-minutes: 120 strategy: fail-fast: false From 2066a4a54753fdafc5e3c9bbdb7bbac0ca0edec4 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 13:40:36 +0200 Subject: [PATCH 22/31] Add more messaging to test server --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 3274407556..ca5a24f0f6 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,7 +14,7 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} - runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-12-large' }} + runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13-large' }} timeout-minutes: 120 strategy: fail-fast: false From 34d107e217d9adb3d82883349b357bb7fd8f64e7 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 15:07:08 +0200 Subject: [PATCH 23/31] Attempt simplifying server to diagnose android simulator issue --- install-tests/react-native/cli.ts | 112 ++++++++++++++++-------------- 1 file changed, 61 insertions(+), 51 deletions(-) diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index 60362d7f43..50437998fe 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -236,66 +236,76 @@ yargs(hideBin(process.argv)) const message = waitForMessage(server); // Start the app - if (platform === "android") { - // Using --active-arch-only to speed things up 🙏 - exec( - "npx", - [ - "react-native", - "run-android", - "--no-packager", - "--active-arch-only", - ...(release ? ["--variant", "release"] : []), - ], - { cwd: appPath, env }, - ); - // Expose the port we're listening on - console.log(`Exposing port ${PORT}`); - exec("adb", ["reverse", `tcp:${PORT}`, `tcp:${PORT}`]); - } else if (platform === "ios") { - // TODO: Start building using ccache - exec( - "npx", - ["react-native", "run-ios", "--no-packager", ...(release ? ["--configuration", "Release"] : [])], - { - cwd: appPath, - env, - }, - ); - } + // if (platform === "android") { + // // Using --active-arch-only to speed things up 🙏 + // exec( + // "npx", + // [ + // "react-native", + // "run-android", + // "--no-packager", + // "--active-arch-only", + // ...(release ? ["--variant", "release"] : []), + // ], + // { cwd: appPath, env }, + // ); + // // Expose the port we're listening on + // console.log(`Exposing port ${PORT}`); + // exec("adb", ["reverse", `tcp:${PORT}`, `tcp:${PORT}`]); + // } else if (platform === "ios") { + // // TODO: Start building using ccache + // exec( + // "npx", + // ["react-native", "run-ios", "--no-packager", ...(release ? ["--configuration", "Release"] : [])], + // { + // cwd: appPath, + // env, + // }, + // ); + // } // Start the countdown - const timeout = new Promise((_, reject) => { - const timer = setTimeout(() => { - const sec = Math.floor(TIMEOUT / 1000); - const err = new Error(`It took too long (> ${sec}s) for the app to send the message`); - reject(err); - }, TIMEOUT); - // Makes sure this doesn't hang the process on successful exit - server.on("connection", () => { - clearTimeout(timer); - }); - }); + // const timeout = new Promise((_, reject) => { + // const timer = setTimeout(() => { + // const sec = Math.floor(TIMEOUT / 1000); + // const err = new Error(`It took too long (> ${sec}s) for the app to send the message`); + // reject(err); + // }, TIMEOUT); + // // Makes sure this doesn't hang the process on successful exit + // server.on("connection", () => { + // clearTimeout(timer); + // }); + // }); // Await the response from the server or a timeout - const actualMessage = await Promise.race([message, timeout]); - console.log(`App sent "${actualMessage}"!`); - const expectedMessage = "Persons are Alice, Bob, Charlie!"; - if (actualMessage === expectedMessage) { - console.log("... which was expected ✅"); - } else { - return new Error(`Expected '${expectedMessage}', got '${actualMessage}'`); - } + // const actualMessage = await Promise.race([message, timeout]); + // console.log(`App sent "${actualMessage}"!`); + // const expectedMessage = "Persons are Alice, Bob, Charlie!"; + // if (actualMessage === expectedMessage) { + // console.log("... which was expected ✅"); + // } else { + // return new Error(`Expected '${expectedMessage}', got '${actualMessage}'`); + // } } finally { // Kill metro, in silence console.log("exiting metro..."); metro.removeListener("exit", prematureExitCallback); - metro.kill(); - console.log("shuting down server..."); + const metroKillResult = metro.kill(); + + console.log(`metro kill result: ${metroKillResult}`); + + console.log("shutting down server..."); // Stop listening for the app - server.close(); - console.log("test complete"); - process.exit(); + server.close(() => { + console.log("Closed out remaining connections."); + process.exit(); + }); + + // If server shutdown doesn't finish in 10 seconds, force it. + setTimeout(() => { + console.error("Could not close connections in time, forcefully shutting down"); + process.exit(1); + }, 10 * 1000); } }, ) From 83e3f13d0e3cdc3906e3297202ccce10a455fdd8 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 15:31:31 +0200 Subject: [PATCH 24/31] Turn off interactive mode --- install-tests/react-native/cli.ts | 112 +++++++++++++----------------- 1 file changed, 49 insertions(+), 63 deletions(-) diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index 50437998fe..19b0958982 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -224,7 +224,7 @@ yargs(hideBin(process.argv)) process.exit(code || 1); } - const metro = cp.spawn("npx", ["react-native", "start"], { cwd: appPath, stdio: "inherit" }); + const metro = cp.spawn("npx", ["react-native", "start", "--no-interactive"], { cwd: appPath, stdio: "inherit" }); metro.addListener("exit", prematureExitCallback); const server = createServer().listen(PORT); @@ -236,76 +236,62 @@ yargs(hideBin(process.argv)) const message = waitForMessage(server); // Start the app - // if (platform === "android") { - // // Using --active-arch-only to speed things up 🙏 - // exec( - // "npx", - // [ - // "react-native", - // "run-android", - // "--no-packager", - // "--active-arch-only", - // ...(release ? ["--variant", "release"] : []), - // ], - // { cwd: appPath, env }, - // ); - // // Expose the port we're listening on - // console.log(`Exposing port ${PORT}`); - // exec("adb", ["reverse", `tcp:${PORT}`, `tcp:${PORT}`]); - // } else if (platform === "ios") { - // // TODO: Start building using ccache - // exec( - // "npx", - // ["react-native", "run-ios", "--no-packager", ...(release ? ["--configuration", "Release"] : [])], - // { - // cwd: appPath, - // env, - // }, - // ); - // } + if (platform === "android") { + // Using --active-arch-only to speed things up 🙏 + exec( + "npx", + [ + "react-native", + "run-android", + "--no-packager", + "--active-arch-only", + ...(release ? ["--variant", "release"] : []), + ], + { cwd: appPath, env }, + ); + // Expose the port we're listening on + console.log(`Exposing port ${PORT}`); + exec("adb", ["reverse", `tcp:${PORT}`, `tcp:${PORT}`]); + } else if (platform === "ios") { + // TODO: Start building using ccache + exec( + "npx", + ["react-native", "run-ios", "--no-packager", ...(release ? ["--configuration", "Release"] : [])], + { + cwd: appPath, + env, + }, + ); + } // Start the countdown - // const timeout = new Promise((_, reject) => { - // const timer = setTimeout(() => { - // const sec = Math.floor(TIMEOUT / 1000); - // const err = new Error(`It took too long (> ${sec}s) for the app to send the message`); - // reject(err); - // }, TIMEOUT); - // // Makes sure this doesn't hang the process on successful exit - // server.on("connection", () => { - // clearTimeout(timer); - // }); - // }); + const timeout = new Promise((_, reject) => { + const timer = setTimeout(() => { + const sec = Math.floor(TIMEOUT / 1000); + const err = new Error(`It took too long (> ${sec}s) for the app to send the message`); + reject(err); + }, TIMEOUT); + // Makes sure this doesn't hang the process on successful exit + server.on("connection", () => { + clearTimeout(timer); + }); + }); // Await the response from the server or a timeout - // const actualMessage = await Promise.race([message, timeout]); - // console.log(`App sent "${actualMessage}"!`); - // const expectedMessage = "Persons are Alice, Bob, Charlie!"; - // if (actualMessage === expectedMessage) { - // console.log("... which was expected ✅"); - // } else { - // return new Error(`Expected '${expectedMessage}', got '${actualMessage}'`); - // } + const actualMessage = await Promise.race([message, timeout]); + console.log(`App sent "${actualMessage}"!`); + const expectedMessage = "Persons are Alice, Bob, Charlie!"; + if (actualMessage === expectedMessage) { + console.log("... which was expected ✅"); + } else { + return new Error(`Expected '${expectedMessage}', got '${actualMessage}'`); + } } finally { // Kill metro, in silence - console.log("exiting metro..."); metro.removeListener("exit", prematureExitCallback); - const metroKillResult = metro.kill(); - - console.log(`metro kill result: ${metroKillResult}`); - - console.log("shutting down server..."); + metro.kill(); // Stop listening for the app - server.close(() => { - console.log("Closed out remaining connections."); - process.exit(); - }); - - // If server shutdown doesn't finish in 10 seconds, force it. - setTimeout(() => { - console.error("Could not close connections in time, forcefully shutting down"); - process.exit(1); - }, 10 * 1000); + server.close(() => process.exit()); } }, ) From 89d63538e30a6fccdded7cae61e692215d20cbd2 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 15:46:06 +0200 Subject: [PATCH 25/31] Ensure that node is causing android issues --- .github/workflows/install-test-react-native.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index ca5a24f0f6..0bd5bec2d1 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -27,8 +27,8 @@ jobs: - latest #- next react-native-version: - #- latest - - next + - latest + #- next # - nightly # Enable if it's not too noizy new-architecture: #- true @@ -42,7 +42,7 @@ jobs: #- 13.1 node: # RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15 - - 18 + - 16 # env: # DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app steps: From 26342043c3bfb1d1124c7da9c2f4814cf33b3018 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Wed, 11 Oct 2023 15:59:38 +0200 Subject: [PATCH 26/31] Tweak emulator options --- .github/workflows/install-test-react-native.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 0bd5bec2d1..1fd4d396bb 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -27,8 +27,8 @@ jobs: - latest #- next react-native-version: - - latest - #- next + #- latest + - next # - nightly # Enable if it's not too noizy new-architecture: #- true @@ -42,7 +42,7 @@ jobs: #- 13.1 node: # RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15 - - 16 + - 18 # env: # DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app steps: @@ -107,7 +107,7 @@ jobs: api-level: 29 target: google_apis script: npm test -- --platform android - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-snapshot-load -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true working-directory: install-tests/react-native From 07fb596ecdc1aaa936d348fd862e15cbee41cc53 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Thu, 12 Oct 2023 09:58:06 +0200 Subject: [PATCH 27/31] More cleanup for metro --- install-tests/react-native/cli.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index 19b0958982..9c605ed5f6 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -290,6 +290,17 @@ yargs(hideBin(process.argv)) // Kill metro, in silence metro.removeListener("exit", prematureExitCallback); metro.kill(); + + // Ensure metro is really dead + const METRO_PORT = 8081; + cp.exec(`lsof -i :${METRO_PORT} | grep LISTEN | awk '{print $2}' | xargs kill -9`, (error) => { + if (error) { + console.error(`Failed to kill process on port ${PORT}:`, error); + } else { + console.log(`Killed process on port ${PORT}`); + } + }); + // Stop listening for the app server.close(() => process.exit()); } From 39c445013f707250cc2bb846ccc9bac3d24cedaf Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Thu, 12 Oct 2023 09:58:44 +0200 Subject: [PATCH 28/31] Remove emulator option change --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 1fd4d396bb..ca5a24f0f6 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -107,7 +107,7 @@ jobs: api-level: 29 target: google_apis script: npm test -- --platform android - emulator-options: -no-snapshot-load -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true working-directory: install-tests/react-native From 8fca763fd8a9541ffba236a2f59814c351aad8bf Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Thu, 12 Oct 2023 10:11:05 +0200 Subject: [PATCH 29/31] Run full matrix --- .github/workflows/install-test-react-native.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index ca5a24f0f6..f8560f59b7 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -20,21 +20,21 @@ jobs: fail-fast: false matrix: platform: - #- ios + - ios - android realm-version: #- v11 # Enable if we feel the need - latest - #- next + - next react-native-version: - #- latest + - latest - next # - nightly # Enable if it's not too noizy new-architecture: - #- true + - true - false engine: - #- jsc + - jsc - hermes # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: From aa627571c2e9402b01230de996fac8d0fd531e2a Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Thu, 12 Oct 2023 10:59:30 +0200 Subject: [PATCH 30/31] Cleanup --- .../workflows/install-test-react-native.yml | 22 ++++--------------- install-tests/react-native/cli.ts | 2 ++ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index f8560f59b7..6ec3914b01 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -14,6 +14,7 @@ defaults: jobs: install: name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }} + # macos-13-xlarge is an M1 mac (which has no Android SDK) runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13-large' }} timeout-minutes: 120 strategy: @@ -23,9 +24,9 @@ jobs: - ios - android realm-version: - #- v11 # Enable if we feel the need + - v11 # For the last major version - latest - - next + #- next # For release candidateds react-native-version: - latest - next @@ -39,12 +40,9 @@ jobs: # See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode xcode: - 15.0 - #- 13.1 node: # RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15 - 18 - # env: - # DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -61,30 +59,18 @@ jobs: - name: Configure ccache run: ccache --set-config="compiler_check=content" - # TODO: Remove if this becomes unneeded in the future + # Invoke a specific iPhone simulator to ensure AppleTV is not chosen as the default simulator - uses: futureware-tech/simulator-action@v2 if: ${{ matrix.platform == 'ios' }} with: model: "iPhone 14" - # - name: Invoke the simulator (making subsequent "open -a Simulator" calls work) - # if: ${{ matrix.platform == 'ios' }} - # run: open -a /Applications/Xcode_${{ matrix.xcode }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator - name: Install dependencies of the CLI run: npm ci - name: Initialize app - # Using "--skip-bundle-install" to let the setup-ruby action install the bundle - # Using "--skip-pod-install" to ensure it happens after setup-ruby has executed run: npm run init -- --skip-bundle-install --skip-pod-install --realm-version ${{ matrix.realm-version }} --react-native-version ${{ matrix.react-native-version }} --engine ${{ matrix.engine }} --new-architecture ${{ matrix.new-architecture }} - # - uses: ruby/setup-ruby@v1 - # if: ${{ matrix.platform == 'ios' }} - # with: - # ruby-version: '3.0' - # bundler-cache: true - # working-directory: install-tests/react-native/app - - if: ${{ matrix.platform == 'ios' }} run: pod install working-directory: install-tests/react-native/app/ios diff --git a/install-tests/react-native/cli.ts b/install-tests/react-native/cli.ts index 9c605ed5f6..fc0345a862 100644 --- a/install-tests/react-native/cli.ts +++ b/install-tests/react-native/cli.ts @@ -224,6 +224,7 @@ yargs(hideBin(process.argv)) process.exit(code || 1); } + // --no-interactive was added to turn off the dev menu, which was throwing an EIO error when the process was killed const metro = cp.spawn("npx", ["react-native", "start", "--no-interactive"], { cwd: appPath, stdio: "inherit" }); metro.addListener("exit", prematureExitCallback); @@ -292,6 +293,7 @@ yargs(hideBin(process.argv)) metro.kill(); // Ensure metro is really dead + // If this is removed, it's highly likely the android emulator runner will not shut down correctly const METRO_PORT = 8081; cp.exec(`lsof -i :${METRO_PORT} | grep LISTEN | awk '{print $2}' | xargs kill -9`, (error) => { if (error) { From dcce3945fc085e94f0c28ff0b8d8dfe37ab561d4 Mon Sep 17 00:00:00 2001 From: Andrew Meyer Date: Fri, 13 Oct 2023 12:55:21 +0200 Subject: [PATCH 31/31] Update .github/workflows/install-test-react-native.yml --- .github/workflows/install-test-react-native.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-test-react-native.yml b/.github/workflows/install-test-react-native.yml index 6ec3914b01..e07ff9edf2 100644 --- a/.github/workflows/install-test-react-native.yml +++ b/.github/workflows/install-test-react-native.yml @@ -26,7 +26,7 @@ jobs: realm-version: - v11 # For the last major version - latest - #- next # For release candidateds + #- next # For release candidates react-native-version: - latest - next