From 1510b69d59b42544e033615f878e1954199acd98 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Feb 2026 17:13:03 -0500 Subject: [PATCH] feat: Enhance mobile CI workflow to compare all changes in PRs and streamline analysis commands --- .github/workflows/mobile-ci.yml | 40 ++++++--------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 70219ce4..02aafadc 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -29,10 +29,10 @@ jobs: id: detect run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - # For PR, compare with base branch + # For PR, compare all changes against base branch (not just latest commit) + # Using three-dot syntax (...) shows all files changed in the PR branch BASE_REF="${{ github.event.pull_request.base.ref }}" - HEAD_REF="${{ github.event.pull_request.head.ref }}" - CHANGED_FILES=$(git diff --name-only origin/$BASE_REF..origin/$HEAD_REF 2>/dev/null || echo "") + CHANGED_FILES=$(git diff --name-only origin/$BASE_REF...HEAD 2>/dev/null || echo "") else # For push, compare with previous commit if [[ "${{ github.event.before }}" == "0000000000000000000000000000000000000000" ]]; then @@ -80,32 +80,12 @@ jobs: - name: 📦 Get Flutter dependencies run: | - cd apps/mobile - flutter pub get + make mobile-install - name: 🔨 Run compilation check run: | - cd apps/mobile - echo "⚙️ Running build_runner..." - melos run gen:build 2>&1 || true - - echo "" - 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 "⚙️ Running mobile analyze..." + make mobile-analyze 2>&1 | tee analyze_output.txt || true echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" @@ -140,13 +120,10 @@ jobs: - name: 📦 Get Flutter dependencies run: | - cd apps/mobile - flutter pub get + make mobile-install - name: 🔍 Lint changed Dart files run: | - cd apps/mobile - # Get the list of changed files CHANGED_FILES="${{ needs.detect-changes.outputs.changed-files }}" @@ -159,9 +136,6 @@ 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=()