Skip to content

Commit 0fc91f4

Browse files
committed
Update CI to run tests across both architectures
1 parent 5919e8d commit 0fc91f4

File tree

7 files changed

+46
-14
lines changed

7 files changed

+46
-14
lines changed

.github/actions/install-cocoapods/action.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ runs:
1717
with:
1818
path: |
1919
sample/ios/Pods
20-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('sample/ios/Podfile.lock', 'sample/Gemfile.lock', 'sample/Gemfile', 'package.json', 'sample/package.json', 'modules/@shopify/checkout-sheet-kit/package.json', 'yarn.lock') }}
20+
key: ${{ runner.os }}-cocoapods-na-${{ env.RCT_NEW_ARCH_ENABLED }}-${{ hashFiles('sample/ios/Podfile.lock', 'sample/Gemfile.lock', 'sample/Gemfile', 'package.json', 'sample/package.json', 'modules/@shopify/checkout-sheet-kit/package.json', 'yarn.lock') }}
2121

2222
- name: Install cocoapods
2323
shell: bash
2424
env:
25-
NO_FLIPPER: "1"
25+
NO_FLIPPER: 1
2626
run: |
2727
set -euo pipefail
2828
ROOT=$(pwd)
2929
cd sample
3030
bundle install
3131
cd ios
32-
bundle exec pod install --deployment --repo-update
32+
echo "RCT_NEW_ARCH_ENABLED: ${{ env.RCT_NEW_ARCH_ENABLED }}"
33+
bundle exec pod install --repo-update
3334
cd $ROOT

.github/workflows/ci.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,18 @@ jobs:
8383
create-new-comment: false
8484

8585
test-android:
86-
name: Run Android Tests
86+
name: Run Android Tests (${{ matrix.arch }})
8787
runs-on: ubuntu-latest
8888
timeout-minutes: 20
8989
needs: [lint, test]
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
include:
94+
- arch: Legacy Arch
95+
new_arch_enabled: 'false'
96+
- arch: New Arch
97+
new_arch_enabled: 'true'
9098
steps:
9199
- name: Checkout
92100
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -101,11 +109,12 @@ jobs:
101109
distribution: 'zulu'
102110
java-version: ${{ env.JAVA_VERSION }}
103111

104-
- name: Run Android tests
112+
- name: Run Android tests (${{ matrix.arch }})
105113
timeout-minutes: 20
106114
env:
107115
GRADLE_OPTS: -Xmx4g -XX:MaxMetaspaceSize=768m
108116
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
117+
ORG_GRADLE_PROJECT_newArchEnabled: ${{ matrix.new_arch_enabled }}
109118
run: |
110119
echo "JAVA_HOME: $JAVA_HOME"
111120
java -version
@@ -115,10 +124,18 @@ jobs:
115124
yarn sample test:android --no-daemon
116125
117126
test-ios:
118-
name: Run Swift Tests
127+
name: Run Swift Tests (${{ matrix.arch }})
119128
runs-on: macos-15-xlarge
120129
timeout-minutes: 20
121130
needs: [lint, test]
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
include:
135+
- arch: legacy
136+
new_arch_enabled: 'false'
137+
- arch: new-arch
138+
new_arch_enabled: 'true'
122139
steps:
123140
- name: Checkout
124141
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -139,7 +156,11 @@ jobs:
139156

140157
- name: Install cocoapods
141158
uses: ./.github/actions/install-cocoapods
159+
env:
160+
RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }}
142161

143-
- name: Run Swift tests
162+
- name: Run Swift tests (${{ matrix.arch }})
163+
env:
164+
RCT_NEW_ARCH_ENABLED: ${{ matrix.new_arch_enabled }}
144165
run: |
145166
yarn sample test:ios

modules/@shopify/checkout-sheet-kit/src/components/AcceleratedCheckoutButtons.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,20 @@ export const AcceleratedCheckoutButtons: React.FC<
304304
}
305305
}
306306

307-
// Use legacy view manager; RN 0.80 interop bridges it under Fabric when enabled
307+
/**
308+
* Renderer note: Paper (old renderer) vs Fabric (new renderer).
309+
*
310+
* We intentionally keep supporting both:
311+
* - When Fabric is enabled (RN 0.80+), the Legacy ViewManager Interop layer auto-registers
312+
* an interop component that proxies mount/prop updates/events to our existing Paper
313+
* `RCTViewManager` (`RCTAcceleratedCheckoutButtons`). No dedicated Fabric ComponentView
314+
* is required for this path to work.
315+
* - When Fabric is disabled, this goes through the classic Paper UIManager path.
316+
*
317+
* This preserves the public API while we migrate. When we switch to a true Fabric component
318+
* (codegen + `RCTViewComponentView`), we can replace this with the generated component and
319+
* remove the interop/legacy manager entirely.
320+
*/
308321
const NativeComponent = LegacyAcceleratedCheckoutButtons;
309322

310323
return (

sample/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ target 'ReactNative' do
2525
:path => config[:reactNativePath],
2626
# An absolute path to your application root.
2727
:app_path => "#{Pod::Config.instance.installation_root}/..",
28-
:new_arch_enabled => true
28+
:new_arch_enabled => (ENV['RCT_NEW_ARCH_ENABLED'] == '1' || ENV['RCT_NEW_ARCH_ENABLED']&.downcase == 'true')
2929
)
3030

3131
target 'ReactNativeTests' do

sample/react-native.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,5 @@ module.exports = {
1616
'@shopify/checkout-sheet-kit': {
1717
root: path.resolve(root, 'modules', '@shopify/checkout-sheet-kit'),
1818
},
19-
...(process.env.NO_FLIPPER
20-
? {'react-native-flipper': {platforms: {ios: null}}}
21-
: {}),
2219
},
2320
};

sample/scripts/build_android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -ex
44

55
cd android
66

7-
./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a
7+
./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a -PnewArchEnabled=${ORG_GRADLE_PROJECT_newArchEnabled:-false}

sample/scripts/test_android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set -e
44

55
cd android
66

7-
./gradlew clean generateAndroidManifestFromTemplate test --no-daemon --console=plain -Dorg.gradle.workers.max=1 -PreactNativeArchitectures=arm64-v8a
7+
./gradlew clean generateAndroidManifestFromTemplate test --no-daemon --console=plain -Dorg.gradle.workers.max=1 -PreactNativeArchitectures=arm64-v8a -PnewArchEnabled=${ORG_GRADLE_PROJECT_newArchEnabled:-true}

0 commit comments

Comments
 (0)