LifeMate — Personal, Family & Learning Companion

fix/backend-request-safety
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
yml 118 lines 5.24 KB
Raw
1 name: Verify local device persistence
2
3 on:
4 push:
5 branches: [fix/local-task-persistence]
6 paths:
7 - 'apps/lifemate/**'
8 - '.github/workflows/local-persistence.yml'
9
10 permissions:
11 contents: read
12
13 concurrency:
14 group: local-device-persistence-${{ github.ref }}
15 cancel-in-progress: true
16
17 jobs:
18 flutter-checks:
19 runs-on: ubuntu-latest
20 timeout-minutes: 25
21 defaults:
22 run:
23 working-directory: apps/lifemate
24 steps:
25 - uses: actions/checkout@v4
26 with:
27 persist-credentials: false
28 - uses: subosito/flutter-action@v2
29 with:
30 channel: stable
31 flutter-version: '3.47.6'
32 cache: true
33 - run: flutter pub get
34 - name: Check formatting in persistence change files
35 run: |
36 dart format --output=none --set-exit-if-changed \
37 lib/main.dart lib/phase3_ui.dart lib/role_entry_main.dart \
38 lib/local_data_store.dart lib/local_only_api.dart \
39 test/app_test.dart test/local_persistence_test.dart \
40 test/local_persistence_ui_test.dart integration_test
41 - run: flutter analyze --no-pub
42 - run: flutter test --no-pub --reporter expanded
43
44 android-persistence:
45 needs: flutter-checks
46 runs-on: ubuntu-latest
47 timeout-minutes: 60
48 env:
49 ORG_GRADLE_PROJECT_lifemateLocalTest: 'true'
50 defaults:
51 run:
52 working-directory: apps/lifemate
53 steps:
54 - uses: actions/checkout@v4
55 with:
56 persist-credentials: false
57 - name: Free unused runtimes on the disposable Android runner
58 run: |
59 sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup
60 df -h "$RUNNER_TEMP"
61 - uses: actions/setup-java@v4
62 with:
63 distribution: temurin
64 java-version: '17'
65 - uses: subosito/flutter-action@v2
66 with:
67 channel: stable
68 flutter-version: '3.47.6'
69 cache: true
70 - run: flutter pub get
71 - name: Enable KVM
72 run: |
73 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
74 sudo udevadm control --reload-rules
75 sudo udevadm trigger --name-match=kvm
76 - name: Verify real Android storage across four app processes
77 uses: reactivecircus/android-emulator-runner@v2
78 with:
79 api-level: 35
80 target: google_apis
81 arch: x86_64
82 emulator-port: 5554
83 force-avd-creation: true
84 disk-size: 2048M
85 emulator-boot-timeout: 300
86 disable-animations: true
87 emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
88 working-directory: apps/lifemate
89 # Each command runs in its own shell. Keep pipefail with each test.
90 # --no-uninstall retains SharedPreferences during Flutter test teardown.
91 script: |
92 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=create --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-create.log"'
93 adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
94 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=update --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-update.log"'
95 adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
96 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=archive --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-archive.log"'
97 adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
98 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=verify --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-verify.log"'
99 bash -eo pipefail -c 'adb -s emulator-5554 shell pm path com.example.lifemate.localtest | grep -q "^package:"'
100 adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
101 bash -e -c 'if grep -E "Uninstalling old version|Package install error" "$RUNNER_TEMP"/local-persistence-*.log; then echo "An installation reset invalidated the persistence test."; exit 1; fi'
102 - name: Build local role-entry APK after persistence gates
103 run: flutter build apk --release --no-pub --target=lib/role_entry_main.dart
104 - name: Upload local test APK
105 uses: actions/upload-artifact@v4
106 with:
107 name: LifeGuide-local-persistence-test-apk
108 path: apps/lifemate/build/app/outputs/flutter-apk/app-release.apk
109 if-no-files-found: error
110 retention-days: 14
111 - name: Upload persistence phase logs
112 if: always()
113 uses: actions/upload-artifact@v4
114 with:
115 name: local-persistence-device-logs
116 path: ${{ runner.temp }}/local-persistence-*.log
117 if-no-files-found: warn
118 retention-days: 14