Skip to content

Commit a90ee02

Browse files
committed
change memory settings on github and retry bundle if fails
1 parent f1fb899 commit a90ee02

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

android/gradle.properties.github

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# GitHub Actions-specific Gradle settings
2-
# High-performance settings for 64GB/16CPU runners
2+
# Optimized for E2E builds on GitHub Actions runners
33

4-
# JVM configuration - high-performance for GitHub Actions
5-
org.gradle.jvmargs=-Xmx32g -XX:MaxMetaspaceSize=2g -XX:+UseG1GC -XX:G1HeapRegionSize=32m -XX:+UseStringDeduplication -XX:+OptimizeStringConcat
4+
# JVM configuration - balanced settings to avoid OOM while maintaining performance
5+
# Using 16GB heap to leave room for parallel workers and native memory
6+
org.gradle.jvmargs=-Xmx16g -XX:MaxMetaspaceSize=1g -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+UseStringDeduplication -XX:+OptimizeStringConcat
67

7-
# Enable all performance optimizations for GitHub Actions
8+
# Enable performance optimizations but limit parallelism to prevent OOM
89
org.gradle.parallel=true
910
org.gradle.configureondemand=true
1011
org.gradle.caching=true
1112
org.gradle.daemon=true
12-
org.gradle.workers.max=12
13-
org.gradle.vfs.watch=true
13+
org.gradle.workers.max=6
14+
org.gradle.vfs.watch=false
1415

1516
# CI-specific optimizations - enabled for GitHub Actions
1617
kotlin.incremental=true

scripts/build.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,16 @@ buildAndroidReleaseE2E(){
606606
cp android/gradle.properties.github android/gradle.properties
607607
# E2E builds only need x86_64 for emulator testing, reducing build time and memory usage
608608
echo "Building E2E APKs for $flavor flavor..."
609-
cd android && ./gradlew assemble${flavor}Release app:assemble${flavor}ReleaseAndroidTest -PminSdkVersion=26 -DtestBuildType=release
609+
cd android
610+
611+
# Try building with optimized settings
612+
if ! ./gradlew assemble${flavor}Release app:assemble${flavor}ReleaseAndroidTest -PminSdkVersion=26 -DtestBuildType=release; then
613+
echo "⚠️ Build failed, retrying with reduced parallelism..."
614+
# Kill any remaining daemon
615+
./gradlew --stop || true
616+
# Retry with no parallel builds to reduce memory pressure
617+
./gradlew assemble${flavor}Release app:assemble${flavor}ReleaseAndroidTest -PminSdkVersion=26 -DtestBuildType=release --no-parallel --max-workers=2
618+
fi
610619

611620
# Verify APK files were created
612621
echo ""
@@ -618,12 +627,16 @@ buildAndroidReleaseE2E(){
618627
echo "✅ App APK found: $appApkPath ($(du -h "$appApkPath" | cut -f1))"
619628
else
620629
echo "❌ App APK NOT found at: $appApkPath"
630+
cd ..
631+
return 1
621632
fi
622633

623634
if [ -f "$testApkPath" ]; then
624635
echo "✅ Test APK found: $testApkPath ($(du -h "$testApkPath" | cut -f1))"
625636
else
626637
echo "❌ Test APK NOT found at: $testApkPath"
638+
cd ..
639+
return 1
627640
fi
628641
echo ""
629642

0 commit comments

Comments
 (0)