From 1dd36993738c5bc8c3816f75bb6e06a60123ab8d Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Feb 2026 17:05:56 -0500 Subject: [PATCH] feat: Update mobile CI workflow to use melos for build and analysis --- .github/workflows/mobile-ci.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 54f3f3ee..70219ce4 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -87,17 +87,31 @@ jobs: run: | cd apps/mobile echo "⚙️ Running build_runner..." - flutter pub run build_runner build --delete-conflicting-outputs 2>&1 || true + melos run gen:build 2>&1 || true echo "" - echo "🔬 Running flutter analyze on all files..." - flutter analyze lib/ --no-fatal-infos 2>&1 | tee analyze_output.txt || true + echo "🔬 Running flutter analyze on all packages..." + # Analyze all packages in the workspace + for dir in packages/*/; do + if [ -d "$dir/lib" ]; then + echo "Analyzing: $dir" + flutter analyze "$dir/lib" --no-fatal-infos 2>&1 | tee -a analyze_output.txt || true + fi + done + + # Also analyze apps + for app_dir in apps/*/lib; do + if [ -d "$app_dir" ]; then + echo "Analyzing: $app_dir" + flutter analyze "$app_dir" --no-fatal-infos 2>&1 | tee -a analyze_output.txt || true + fi + done echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" # Check for actual errors (not just warnings) - if grep -E "^\s*(error|SEVERE):" analyze_output.txt > /dev/null; then + if grep -E "^\s*(error|SEVERE):" analyze_output.txt > /dev/null 2>&1; then echo "❌ COMPILATION ERRORS FOUND:" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" grep -B 2 -A 1 -E "^\s*(error|SEVERE):" analyze_output.txt | sed 's/^/ /' @@ -145,6 +159,9 @@ jobs: echo "$CHANGED_FILES" echo "" + # Ensure flutter pub get in workspace + melos bootstrap --no-git-tag-version + # Run dart analyze on each changed file HAS_ERRORS=false FAILED_FILES=() @@ -153,7 +170,7 @@ jobs: if [[ -n "$file" && "$file" == *.dart ]]; then echo "📝 Analyzing: $file" - if ! flutter analyze "$file" --no-fatal-infos 2>&1 | tee -a lint_output.txt; then + if ! dart analyze "$file" --no-fatal-infos 2>&1 | tee -a lint_output.txt; then HAS_ERRORS=true FAILED_FILES+=("$file") fi