-
Notifications
You must be signed in to change notification settings - Fork 188
ci: enable android e2e and config cache #1071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -28,11 +28,10 @@ on: | |||||
|
|
||||||
| jobs: | ||||||
| e2e-android: | ||||||
| if: false # Temporarily disable Android E2E until emulator disk issue resolved | ||||||
| concurrency: | ||||||
| group: ${{ github.workflow }}-android-${{ github.ref }} | ||||||
| cancel-in-progress: true | ||||||
| timeout-minutes: 45 | ||||||
| timeout-minutes: 60 | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: actions/checkout@v4 | ||||||
|
|
@@ -87,6 +86,8 @@ jobs: | |||||
| java-version: ${{ env.JAVA_VERSION }} | ||||||
| - name: Cache Gradle packages | ||||||
| uses: ./.github/actions/cache-gradle | ||||||
| with: | ||||||
| cache-version: ${{ env.GH_CACHE_VERSION }}-${{ hashFiles('app/android/gradle.properties') }} | ||||||
| - name: Setup Android SDK | ||||||
| uses: android-actions/setup-android@v3 | ||||||
| with: | ||||||
|
|
@@ -102,16 +103,19 @@ jobs: | |||||
| run: | | ||||||
| echo "Building Android APK..." | ||||||
| chmod +x app/android/gradlew | ||||||
| (cd app/android && ./gradlew assembleDebug --quiet --parallel --build-cache --no-configuration-cache) || { echo "❌ Android build failed"; exit 1; } | ||||||
| (cd app/android && ./gradlew assembleDebug --quiet --parallel --build-cache) || { echo "❌ Android build failed"; exit 1; } | ||||||
| echo "✅ Android build succeeded" | ||||||
| - name: Clean Android caches | ||||||
| run: | | ||||||
| rm -rf ~/.android/avd/* ~/.gradle/caches/* | ||||||
| - name: Install and Test on Android | ||||||
| uses: reactivecircus/android-emulator-runner@v2 | ||||||
| with: | ||||||
| api-level: ${{ env.ANDROID_API_LEVEL }} | ||||||
| arch: x86_64 | ||||||
| target: google_apis | ||||||
| force-avd-creation: false | ||||||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none -memory 8192 -cores 4 -accel on | ||||||
| emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Increase emulator data partition to prevent INSTALL_FAILED_INSUFFICIENT_STORAGE PR description mentions increasing disk partition, but the flag isn’t present. Low disk often breaks APK install on CI. - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none
+ emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -camera-front none -partition-size 4096📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| disable-animations: true | ||||||
| script: | | ||||||
| echo "Installing app on emulator..." | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| pluginManagement { includeBuild("../../node_modules/@react-native/gradle-plugin") } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove duplicate includeBuild of @react-native/gradle-plugin. Including the same composite build twice can cause settings-evaluation failures (“Build at … is already included”) and undermines configuration-cache stability. Keep the includeBuild only inside pluginManagement. Apply this diff: pluginManagement { includeBuild("../../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex ->
// Use direct autolinking instead of external yarn command to support configuration cache
ex.autolinkLibrariesFromCommand()
}
rootProject.name = 'OpenPassport'
include ':app'
-includeBuild('../../node_modules/@react-native/gradle-plugin')
include ':react-native-passport-reader'
project(':react-native-passport-reader').projectDir = new File(rootProject.projectDir, './react-native-passport-reader/android')
include ':passportreader'
project(':passportreader').projectDir = new File(rootProject.projectDir, './android-passport-reader/app')Also applies to: 9-9 🤖 Prompt for AI Agents |
||
| plugins { id("com.facebook.react.settings") } | ||
| extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> | ||
| ex.autolinkLibrariesFromCommand(['yarn','exec','react-native','config']) | ||
| // Use direct autolinking instead of external yarn command to support configuration cache | ||
| ex.autolinkLibrariesFromCommand() | ||
| } | ||
| rootProject.name = 'OpenPassport' | ||
| include ':app' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not delete ~/.gradle/caches before cache save — this neuters Gradle caching for subsequent runs
This step runs before the post‑step that saves the cache, so you end up saving an empty/cleared cache, losing most performance gains.
📝 Committable suggestion
🤖 Prompt for AI Agents