diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 5f18d948..4a6e43ee 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 @@ -74,39 +74,47 @@ jobs: - name: ๐Ÿฆ‹ Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.19.x' + flutter-version: '3.38.x' channel: 'stable' cache: true + - name: ๐Ÿ”ง Install Firebase CLI + run: | + npm install -g firebase-tools + - 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..." - flutter pub run build_runner build --delete-conflicting-outputs 2>&1 || true - - echo "" - echo "๐Ÿ”ฌ Running flutter analyze on all files..." - flutter analyze lib/ --no-fatal-infos 2>&1 | tee analyze_output.txt || true + set -o pipefail + + echo "๐Ÿ—๏ธ Building client app for Android (dev mode)..." + if ! make mobile-client-build PLATFORM=apk MODE=debug 2>&1 | tee client_build.txt; then + echo "" + echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" + echo "โŒ CLIENT APP BUILD FAILED" + echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" + exit 1 + fi echo "" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" - # Check for actual errors (not just warnings) - if grep -E "^\s*(error|SEVERE):" analyze_output.txt > /dev/null; then - echo "โŒ COMPILATION ERRORS FOUND:" + echo "๐Ÿ—๏ธ Building staff app for Android (dev mode)..." + if ! make mobile-staff-build PLATFORM=apk MODE=debug 2>&1 | tee staff_build.txt; then + echo "" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" - grep -B 2 -A 1 -E "^\s*(error|SEVERE):" analyze_output.txt | sed 's/^/ /' + echo "โŒ STAFF APP BUILD FAILED" echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" exit 1 - else - echo "โœ… Compilation check PASSED - No errors found" - echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" fi + + echo "" + echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" + echo "โœ… Build check PASSED - Both apps built successfully" + echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”" lint: name: ๐Ÿงน Lint Changed Files @@ -120,18 +128,21 @@ jobs: - name: ๐Ÿฆ‹ Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.19.x' + flutter-version: '3.38.x' channel: 'stable' cache: true + - name: ๐Ÿ”ง Install Firebase CLI + run: | + npm install -g firebase-tools + - name: ๐Ÿ“ฆ Get Flutter dependencies run: | - cd apps/mobile - flutter pub get + make mobile-install - name: ๐Ÿ” Lint changed Dart files run: | - cd apps/mobile + set -o pipefail # Get the list of changed files CHANGED_FILES="${{ needs.detect-changes.outputs.changed-files }}" @@ -153,7 +164,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" 2>&1 | tee -a lint_output.txt; then HAS_ERRORS=true FAILED_FILES+=("$file") fi diff --git a/apps/mobile/pubspec.lock b/apps/mobile/pubspec.lock index d9afe13f..9aa8910e 100644 --- a/apps/mobile/pubspec.lock +++ b/apps/mobile/pubspec.lock @@ -1530,4 +1530,4 @@ packages: version: "2.2.3" sdks: dart: ">=3.10.3 <4.0.0" - flutter: ">=3.38.4" + flutter: ">=3.38.4 <4.0.0" diff --git a/apps/mobile/pubspec.yaml b/apps/mobile/pubspec.yaml index 6ffcd99f..bca32555 100644 --- a/apps/mobile/pubspec.yaml +++ b/apps/mobile/pubspec.yaml @@ -3,6 +3,7 @@ publish_to: 'none' description: "A sample project using melos and modular scaffold." environment: sdk: '>=3.10.0 <4.0.0' + flutter: '>=3.38.0 <4.0.0' workspace: - packages/design_system - packages/core