-
Notifications
You must be signed in to change notification settings - Fork 1
YPE-1180 Add Android example app build tests #35
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
base: main
Are you sure you want to change the base?
Conversation
|
I believe that the current failure on the added test is legit and shows the failures I was seeing before my changes in the other PR. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Greptile OverviewGreptile SummaryAdded a new GitHub Actions workflow to automatically test Android example app builds on pull requests. The workflow sets up Node.js 20 and Java 17, installs dependencies for both the root project and example app, uses Expo's prebuild to generate the native Android project, and then builds the debug APK using Gradle. Key Changes:
Suggestions:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant PR as Pull Request
participant GHA as GitHub Actions
participant Node as Node.js Environment
participant Expo as Expo CLI
participant Gradle as Gradle Build System
PR->>GHA: Trigger on PR to main
GHA->>GHA: Checkout repository
GHA->>Node: Setup Node.js 20 with npm cache
GHA->>GHA: Setup Java 17 (Temurin)
GHA->>Node: Install root dependencies (npm ci)
GHA->>Node: Install example app dependencies (npm ci)
Node->>Expo: Run expo prebuild --clean --platform android
Expo->>Expo: Generate Android native project
Expo->>Gradle: Create gradlew and Android build files
GHA->>Gradle: Execute ./gradlew assembleDebug --no-daemon
Gradle->>Gradle: Build Android APK
Gradle->>GHA: Return build result
GHA->>PR: Report success/failure
|
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.
1 file reviewed, 3 comments
| - name: Setup Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '17' |
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.
Consider adding Gradle dependency caching to speed up builds:
- name: Setup Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/android_example_test_build.yml
Line: 21:25
Comment:
Consider adding Gradle dependency caching to speed up builds:
```
- name: Setup Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
```
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Cameron Llewellyn <cameron.b.llewellyn@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Cameron Llewellyn <cameron.b.llewellyn@gmail.com>
bmanquen
left a comment
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.
I am learning about android and iOS so take my comments with a grain of salt.
|
Also I think we can probably test the android and ios builds in one github workflow file as long as they are in different jobs. |
|
|
||
| - name: Build Android app | ||
| working-directory: example/android | ||
| run: ./gradlew assembleDebug --no-daemon |
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.
This works! You could also set the working-directory to example and run npm run android.
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.
When I did that in CI it failed because there was no simulator device.
| working-directory: example | ||
| run: npm ci | ||
|
|
||
| - name: Prebuild Expo 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.
Actually, this could also (similar to iOS) be simplified to 1 command: npm run android. It will handle prebuild (creating the Android native directory) and building the 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.
I will try this again but I think doing this it was having issues with building since no simulator exists.
Description
We had broken example app builds. This adds the tests to build the Android app.
Type of Change
feat:New feature (non-breaking change which adds functionality)fix:Bug fix (non-breaking change which fixes an issue)docs:Documentation updaterefactor:Code refactoring (no functional changes)perf:Performance improvementtest:Test additions or updatesbuild:Build system or dependency changesci:CI configuration changeschore:Other changes (maintenance, etc.)Checklist