Skip to content

Commit ab7506c

Browse files
authored
feat: add new architecture support via Legacy Interop (#26)
1 parent 6aa89f4 commit ab7506c

File tree

83 files changed

+9452
-5212
lines changed

Some content is hidden

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

83 files changed

+9452
-5212
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
- name: Setup
3636
uses: ./.github/actions/setup
3737

38-
- name: Run unit tests
39-
run: yarn test --maxWorkers=2 --coverage
40-
4138
build-library:
4239
runs-on: ubuntu-latest
4340
steps:
@@ -52,45 +49,24 @@ jobs:
5249

5350
build-android:
5451
runs-on: ubuntu-latest
55-
env:
56-
TURBO_CACHE_DIR: .turbo/android
5752
steps:
5853
- name: Checkout
5954
uses: actions/checkout@v3
6055

6156
- name: Setup
6257
uses: ./.github/actions/setup
6358

64-
- name: Cache turborepo for Android
65-
uses: actions/cache@v3
66-
with:
67-
path: ${{ env.TURBO_CACHE_DIR }}
68-
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
69-
restore-keys: |
70-
${{ runner.os }}-turborepo-android-
71-
72-
- name: Check turborepo cache for Android
73-
run: |
74-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
75-
76-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
77-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
78-
fi
79-
8059
- name: Install JDK
81-
if: env.turbo_cache_hit != 1
8260
uses: actions/setup-java@v3
8361
with:
8462
distribution: 'zulu'
8563
java-version: '17'
8664

8765
- name: Finalize Android SDK
88-
if: env.turbo_cache_hit != 1
8966
run: |
9067
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
9168
9269
- name: Cache Gradle
93-
if: env.turbo_cache_hit != 1
9470
uses: actions/cache@v3
9571
with:
9672
path: |
@@ -100,62 +76,70 @@ jobs:
10076
restore-keys: |
10177
${{ runner.os }}-gradle-
10278
103-
- name: Build example for Android
79+
- name: Build Android example (Paper)
10480
env:
10581
JAVA_OPTS: "-XX:MaxHeapSize=6g"
106-
run: |
107-
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
82+
run: yarn android:paper:build
83+
84+
- name: Build Android example (Fabric)
85+
env:
86+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
87+
run: yarn android:fabric:build
10888

10989
build-ios:
11090
runs-on: macos-14
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
mode: [paper, fabric]
11195
env:
112-
TURBO_CACHE_DIR: .turbo/ios
96+
RCT_NEW_ARCH_ENABLED: ${{ matrix.mode == 'fabric' && '1' || '0' }}
11397
steps:
11498
- name: Checkout
11599
uses: actions/checkout@v3
116100

117-
- name: Setup
118-
uses: ./.github/actions/setup
119-
120-
- name: Cache turborepo for iOS
121-
uses: actions/cache@v3
101+
- name: Select Xcode 16.1
102+
uses: maxim-lobanov/setup-xcode@v1
122103
with:
123-
path: ${{ env.TURBO_CACHE_DIR }}
124-
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
125-
restore-keys: |
126-
${{ runner.os }}-turborepo-ios-
104+
xcode-version: '16.1'
127105

128-
- name: Check turborepo cache for iOS
129-
run: |
130-
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
131-
132-
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
133-
echo "turbo_cache_hit=1" >> $GITHUB_ENV
134-
fi
106+
- name: Setup
107+
uses: ./.github/actions/setup
135108

136-
- name: Cache cocoapods
137-
if: env.turbo_cache_hit != 1
109+
- name: Cache CocoaPods
138110
id: cocoapods-cache
139111
uses: actions/cache@v3
140112
with:
141113
path: |
142-
**/ios/Pods
143-
**/ios/build/generated/ios
144-
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
114+
example/ios/Pods
115+
example/ios/build/generated/ios
116+
key: ${{ runner.os }}-cocoapods-${{ matrix.mode }}-${{ hashFiles('example/ios/Podfile.lock') }}
145117
restore-keys: |
146-
${{ runner.os }}-cocoapods-
118+
${{ runner.os }}-cocoapods-${{ matrix.mode }}-
147119
148-
- name: Install cocoapods
149-
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
120+
- name: Install CocoaPods
150121
run: |
151122
cd example/ios
152-
pod install
123+
set -o pipefail
124+
if ! pod install; then
125+
echo "pod install failed; retrying after updating hermes-engine" >&2
126+
pod update hermes-engine --no-repo-update
127+
pod install
128+
fi
153129
env:
154130
NO_FLIPPER: 1
155131

156-
- name: Build example for iOS
157-
run: |
158-
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
132+
- name: Ensure DerivedData directory
133+
run: mkdir -p ~/Library/Developer/Xcode/DerivedData
134+
135+
- name: Cache DerivedData
136+
uses: actions/cache@v3
137+
with:
138+
path: ~/Library/Developer/Xcode/DerivedData/example-*
139+
key: ${{ runner.os }}-deriveddata-${{ matrix.mode }}-${{ hashFiles('example/ios/Podfile.lock') }}
140+
141+
- name: Build iOS example (${{ matrix.mode }})
142+
run: yarn ios:${{ matrix.mode }}:build
159143

160144
build-web:
161145
runs-on: ubuntu-latest

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ android/keystores/debug.keystore
7070

7171
# Expo
7272
.expo/
73+
expo-example/android/
74+
expo-example/ios/
7375

7476
# Turborepo
7577
.turbo/

0 commit comments

Comments
 (0)