feat: Update mobile CI workflow to use melos for build and analysis

This commit is contained in:
Achintha Isuru
2026-02-19 17:05:56 -05:00
parent b6c3fb8487
commit 1dd3699373

View File

@@ -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