feat: Update mobile CI workflow to streamline build process and remove CI-specific setup

This commit is contained in:
Achintha Isuru
2026-02-20 01:26:13 -05:00
parent 767b10e337
commit 614851274b
3 changed files with 25 additions and 21 deletions

View File

@@ -84,25 +84,39 @@ jobs:
- name: 📦 Get Flutter dependencies - name: 📦 Get Flutter dependencies
run: | run: |
make mobile-install-ci make mobile-install
- name: 🔨 Run compilation check - name: 🔨 Run compilation check
run: | run: |
echo " Running mobile analyze..." echo "🏗 Building client app for Android (dev mode)..."
make mobile-analyze 2>&1 | tee analyze_output.txt || true make mobile-client-build PLATFORM=apk MODE=dev 2>&1 | tee client_build.txt || true
echo "" echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Check for actual errors (not just warnings) echo "🏗️ Building staff app for Android (dev mode)..."
if grep -E "^\s*(error|SEVERE):" analyze_output.txt > /dev/null 2>&1; then make mobile-staff-build PLATFORM=apk MODE=dev 2>&1 | tee staff_build.txt || true
echo "❌ COMPILATION ERRORS FOUND:"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
grep -B 2 -A 1 -E "^\s*(error|SEVERE):" analyze_output.txt | sed 's/^/ /'
# Check for actual errors in both builds
if grep -E "^\s*(error|SEVERE|Error|failed)" client_build.txt > /dev/null 2>&1 || \
grep -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt > /dev/null 2>&1; then
echo "❌ BUILD ERRORS FOUND:"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
if grep -E "^\s*(error|SEVERE|Error|failed)" client_build.txt > /dev/null 2>&1; then
echo " CLIENT BUILD:"
grep -B 2 -A 1 -E "^\s*(error|SEVERE|Error|failed)" client_build.txt | sed 's/^/ /'
fi
if grep -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt > /dev/null 2>&1; then
echo " STAFF BUILD:"
grep -B 2 -A 1 -E "^\s*(error|SEVERE|Error|failed)" staff_build.txt | sed 's/^/ /'
fi
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
exit 1 exit 1
else else
echo "✅ Compilation check PASSED - No errors found" echo "✅ Build check PASSED - Both apps built successfully"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
fi fi
@@ -128,7 +142,7 @@ jobs:
- name: 📦 Get Flutter dependencies - name: 📦 Get Flutter dependencies
run: | run: |
make mobile-install-ci make mobile-install
- name: 🔍 Lint changed Dart files - name: 🔍 Lint changed Dart files
run: | run: |

View File

@@ -19,7 +19,7 @@ else
$(error Invalid DC_ENV '$(DC_ENV)'. Use DC_ENV=dev or DC_ENV=validation) $(error Invalid DC_ENV '$(DC_ENV)'. Use DC_ENV=dev or DC_ENV=validation)
endif endif
.PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-generate-sdk-ci dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta dataconnect-clean dataconnect-bootstrap-validation-db dataconnect-file dataconnect-file-validation dataconnect-file-dev dataconnect-seed dataconnect-test .PHONY: dataconnect-enable-apis dataconnect-init dataconnect-deploy dataconnect-sql-migrate dataconnect-generate-sdk dataconnect-sync dataconnect-bootstrap-db check-gcloud-beta dataconnect-clean dataconnect-bootstrap-validation-db dataconnect-file dataconnect-file-validation dataconnect-file-dev dataconnect-seed dataconnect-test
#creation dataconnect file #creation dataconnect file
dataconnect-file: dataconnect-file:
@@ -79,9 +79,6 @@ dataconnect-generate-sdk: dataconnect-file
@firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS) @firebase dataconnect:sdk:generate --project=$(FIREBASE_ALIAS)
@echo "✅ Data Connect SDK generation completed for [$(DC_ENV)]." @echo "✅ Data Connect SDK generation completed for [$(DC_ENV)]."
# CI version: same as regular since Firebase CLI is now installed in CI
dataconnect-generate-sdk-ci: dataconnect-generate-sdk
# Unified backend schema update workflow (schema -> deploy -> SDK) # Unified backend schema update workflow (schema -> deploy -> SDK)
dataconnect-sync: dataconnect-file dataconnect-sync: dataconnect-file
@echo "--> [1/3] Deploying Data Connect [$(DC_SERVICE)]..." @echo "--> [1/3] Deploying Data Connect [$(DC_SERVICE)]..."

View File

@@ -1,6 +1,6 @@
# --- Mobile App Development --- # --- Mobile App Development ---
.PHONY: mobile-install mobile-install-ci mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart .PHONY: mobile-install mobile-info mobile-analyze mobile-client-dev-android mobile-staff-dev-android mobile-client-build mobile-staff-build mobile-hot-reload mobile-hot-restart
MOBILE_DIR := apps/mobile MOBILE_DIR := apps/mobile
@@ -15,13 +15,6 @@ mobile-install: install-melos dataconnect-generate-sdk
@echo "--> Generating localization files..." @echo "--> Generating localization files..."
@cd $(MOBILE_DIR) && melos run gen:l10n @cd $(MOBILE_DIR) && melos run gen:l10n
mobile-install-ci: install-melos dataconnect-generate-sdk-ci
@echo "--> Bootstrapping mobile workspace for CI (Melos)..."
@cd $(MOBILE_DIR) && melos bootstrap
@echo "--> Generating localization files..."
@cd $(MOBILE_DIR) && melos run gen:l10n
@echo "✅ CI mobile setup complete"
mobile-info: mobile-info:
@echo "--> Fetching mobile command info..." @echo "--> Fetching mobile command info..."
@cd $(MOBILE_DIR) && melos run info @cd $(MOBILE_DIR) && melos run info