-
-
Notifications
You must be signed in to change notification settings - Fork 272
chore: move Android+iOS native builds from CI to a local pre-push gate #608
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -40,6 +40,12 @@ PUSHED_JS=$(printf '%s\n' "$CHANGED_FILES" | grep -E '\.(ts|tsx|js|jsx)$' || tru | |||||
| PUSHED_SWIFT=$(printf '%s\n' "$CHANGED_FILES" | grep '\.swift$' | grep -v 'Pods/' | grep -v 'build/' || true) | ||||||
| PUSHED_KOTLIN=$(printf '%s\n' "$CHANGED_FILES" | grep -E '\.(kt|kts)$' || true) | ||||||
|
|
||||||
| # Native BUILD gate — moved OUT of CI (the hosted android-build runner hung for 3+ hours on the | ||||||
| # native C++ builds). Run the full native builds LOCALLY on push when native / gradle / pods / deps | ||||||
| # change. JS-only and docs-only pushes skip these (they stay fast). | ||||||
| PUSHED_ANDROID_NATIVE=$(printf '%s\n' "$CHANGED_FILES" | grep -E '\.(kt|kts)$|^android/|^package(-lock)?\.json$' | grep -v '/build/' || true) | ||||||
|
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Include all declared Android gate inputs. This matcher misses native C++ files and Gradle inputs outside Proposed fix-PUSHED_ANDROID_NATIVE=$(printf '%s\n' "$CHANGED_FILES" | grep -E '\.(kt|kts)$|^android/|^package(-lock)?\.json$' | grep -v '/build/' || true)
+PUSHED_ANDROID_NATIVE=$(printf '%s\n' "$CHANGED_FILES" | grep -E '\.(kt|kts|c|cc|cpp|cxx|h|hpp)$|^android/|^gradle/|^gradlew$|(^|/)gradle\.properties$|\.gradle$|^package(-lock)?\.json$' | grep -v '/build/' || true)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| PUSHED_IOS_NATIVE=$(printf '%s\n' "$CHANGED_FILES" | grep -E '\.swift$|^ios/|Podfile' | grep -v 'Pods/' | grep -v '/build/' || true) | ||||||
|
|
||||||
| if [ -n "$PUSHED_JS" ]; then | ||||||
| echo "▶ JS/TS lint (push range)..." | ||||||
| echo "$PUSHED_JS" | tr '\n' '\0' | xargs -0 eslint --max-warnings=999 | ||||||
|
|
@@ -83,6 +89,24 @@ if [ -n "$PUSHED_KOTLIN" ]; then | |||||
| npm run test:android | ||||||
| fi | ||||||
|
|
||||||
| if [ -n "$PUSHED_ANDROID_NATIVE" ]; then | ||||||
| echo "▶ Android build (assembleDebug + assembleRelease) — local gate, replaces CI android-build..." | ||||||
| (cd android && ./gradlew assembleDebug assembleRelease) | ||||||
| fi | ||||||
|
|
||||||
| if [ -n "$PUSHED_IOS_NATIVE" ]; then | ||||||
| echo "▶ iOS build (simulator, no code-signing) — local gate..." | ||||||
| (cd ios && xcodebuild \ | ||||||
| -workspace OffgridMobile.xcworkspace \ | ||||||
| -scheme OffgridMobile \ | ||||||
| -configuration Debug \ | ||||||
| -sdk iphonesimulator \ | ||||||
| -destination 'generic/platform=iOS Simulator' \ | ||||||
| -derivedDataPath build/prepush-ios \ | ||||||
| CODE_SIGNING_ALLOWED=NO \ | ||||||
| build) | ||||||
| fi | ||||||
|
Comment on lines
+92
to
+108
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. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/sh
sed -n '1,115p' .husky/pre-pushRepository: off-grid-ai/OGAM Length of output: 4068 Make native build failures fail the pre-push hook.
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| if [ -n "$PUSHED_JS$PUSHED_SWIFT$PUSHED_KOTLIN" ]; then | ||||||
| echo "▶ Sonar scan..." | ||||||
| npm run sonar | ||||||
|
|
||||||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Narrow “Android build is NOT run in CI” to the removed assemble job.
The
testjob still installs the Android NDK and runs:app:testDebugUnitTestat Line [168]. As written, this note may imply that CI performs no Android validation at all.Proposed wording
📝 Committable suggestion
🤖 Prompt for AI Agents
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: off-grid-ai/OGAM
Length of output: 154
🏁 Script executed:
Repository: off-grid-ai/OGAM
Length of output: 227
🏁 Script executed:
Repository: off-grid-ai/OGAM
Length of output: 427
Remove or fix the stale references.
rules.mdis not present, and the referencedcd android && ./gradlew assembleDebug assembleReleasecommand is not in the repository. Keep the comment only if the exact gate command and exceptions are added torules.md; otherwise, update it to a real, discoverable pre-merge process.🤖 Prompt for AI Agents