Skip to content

Commit 75cd8e8

Browse files
committed
ci: add new arch job
1 parent 82a1737 commit 75cd8e8

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,62 @@ jobs:
107107
run: |
108108
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
109109
110+
build-android-newarch:
111+
runs-on: ubuntu-latest
112+
env:
113+
TURBO_CACHE_DIR: .turbo/android-newarch
114+
steps:
115+
- name: Checkout
116+
uses: actions/checkout@v3
117+
118+
- name: Setup
119+
uses: ./.github/actions/setup
120+
121+
- name: Cache turborepo for Android new arch
122+
uses: actions/cache@v3
123+
with:
124+
path: ${{ env.TURBO_CACHE_DIR }}
125+
key: ${{ runner.os }}-turborepo-android-newarch-${{ hashFiles('yarn.lock') }}
126+
restore-keys: |
127+
${{ runner.os }}-turborepo-android-newarch-
128+
129+
- name: Check turborepo cache for Android new arch
130+
run: |
131+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android:fabric --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android:fabric').cache.status")
132+
133+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
134+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
135+
fi
136+
137+
- name: Install JDK
138+
if: env.turbo_cache_hit != 1
139+
uses: actions/setup-java@v3
140+
with:
141+
distribution: 'zulu'
142+
java-version: '17'
143+
144+
- name: Finalize Android SDK
145+
if: env.turbo_cache_hit != 1
146+
run: |
147+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
148+
149+
- name: Cache Gradle
150+
if: env.turbo_cache_hit != 1
151+
uses: actions/cache@v3
152+
with:
153+
path: |
154+
~/.gradle/wrapper
155+
~/.gradle/caches
156+
key: ${{ runner.os }}-gradle-newarch-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
157+
restore-keys: |
158+
${{ runner.os }}-gradle-newarch-
159+
160+
- name: Build example for Android new arch
161+
env:
162+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
163+
run: |
164+
yarn turbo run build:android:fabric --cache-dir="${{ env.TURBO_CACHE_DIR }}"
165+
110166
build-ios:
111167
runs-on: macos-15
112168
env:

example/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
4040
# to write custom TurboModules/Fabric components OR use libraries that
4141
# are providing them.
4242
# Note that this is incompatible with web debugging.
43-
newArchEnabled=true
43+
newArchEnabled=false
4444
#bridgelessEnabled=true
4545

4646
# Uncomment the line below to build React Native from source.

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"android": "react-native run-android",
77
"build:android": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist && react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a\"",
8+
"build:android:fabric": "npm run mkdist && react-native bundle --entry-file index.js --platform android --dev true --bundle-output dist/main.android.jsbundle --assets-dest dist && react-native build-android --extra-params \"--no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a -PnewArchEnabled=true\"",
89
"build:ios": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.ios.jsbundle --assets-dest dist && react-native build-ios --scheme ReactNativeBottomTabs --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\"",
910
"build:visionos": "npm run mkdist && react-native bundle --entry-file index.js --platform ios --dev true --bundle-output dist/main.visionos.jsbundle --assets-dest dist",
1011
"ios": "react-native run-ios",

0 commit comments

Comments
 (0)