LifeMate — Personal, Family & Learning Companion

feat/local-signing-preflight
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 121 lines 6.21 KB
Raw
1 name: LifeGuide personal recovery emulator QA
2 on:
3 pull_request:
4 paths:
5 - .github/workflows/personal-recovery-android.yml
6 - apps/lifemate/tool/*personal_recovery*
7 - apps/lifemate/android/app/src/recoveryQa/**
8 - apps/lifemate/android/app/build.gradle.kts
9 - apps/lifemate/android/app/src/main/kotlin/ir/lifeguide/app/**
10 workflow_dispatch:
11 permissions:
12 contents: read
13 actions: read
14 concurrency:
15 group: lifeguide-recovery-qa-${{ github.ref }}
16 cancel-in-progress: true
17 jobs:
18 synthetic-emulator:
19 runs-on: ubuntu-latest
20 timeout-minutes: 40
21 defaults:
22 run: {working-directory: apps/lifemate}
23 env:
24 ORG_GRADLE_PROJECT_lifeguideDevicePlanner: 'true'
25 ORG_GRADLE_PROJECT_lifeguidePersonalRecoveryQa: 'true'
26 steps:
27 - uses: actions/checkout@v4
28 - uses: actions/setup-python@v5
29 with: {python-version: '3.11'}
30 - run: python -m pip install -r ../../requirements-personal-recovery.txt
31 - uses: actions/setup-java@v4
32 with: {distribution: temurin, java-version: '17'}
33 - uses: subosito/flutter-action@v2
34 with: {flutter-version: '3.47.6', channel: stable, cache: true}
35 - run: flutter pub get
36 - name: Host safety and ordinary planner checks
37 run: |
38 dart format --output=none --set-exit-if-changed tool/personal_recovery_fixture.dart
39 flutter analyze
40 flutter test
41 python -m unittest discover -s tool -p '*_test.py' -v
42 cd ../..
43 python -m unittest discover -s scripts/tests -p 'test_recovery*.py' -v
44 - name: Retrieve exact original delivered APK, never a rebuilt substitute
45 uses: actions/download-artifact@v4
46 with:
47 artifact-ids: '12292340083'
48 run-id: '39480587450'
49 github-token: ${{ github.token }}
50 repository: davoodmehraban89/LifeMate
51 path: apps/lifemate/build/original-delivered
52 merge-multiple: true
53 - name: Build two private QA versions with the same ephemeral test signer
54 run: |
55 for code in 10 11; do
56 flutter build apk --debug --target=tool/personal_recovery_fixture.dart --dart-define=LIFEGUIDE_STANDALONE=true --dart-define=LIFEGUIDE_PERSONAL_RECOVERY_QA=true --build-name="0.7.2-recovery-qa.$code" --build-number="$code"
57 cp build/app/outputs/flutter-apk/app-debug.apk "build/recovery-qa-$code.apk"
58 python tool/check_personal_recovery_apk.py "build/recovery-qa-$code.apk" --expected-code "$code"
59 done
60 - name: Actually reject unsafe QA build combinations
61 working-directory: apps/lifemate/android
62 shell: bash
63 run: |
64 set -euo pipefail
65 defines=$(python -c 'import base64; print(",".join(base64.b64encode(x.encode()).decode() for x in ("LIFEGUIDE_STANDALONE=true", "LIFEGUIDE_PERSONAL_RECOVERY_QA=true")))')
66 expect_refusal() {
67 reason="$1"
68 shift
69 log_file=$(mktemp)
70 if "$@" > "$log_file" 2>&1; then
71 rm -f "$log_file"
72 echo 'FAIL: forbidden build unexpectedly succeeded'
73 exit 1
74 fi
75 if ! grep -Fq "$reason" "$log_file"; then
76 tail -n 40 "$log_file"
77 rm -f "$log_file"
78 echo 'FAIL: build failed without the expected safety refusal'
79 exit 1
80 fi
81 rm -f "$log_file"
82 echo "PASS: $reason"
83 }
84 expect_refusal 'requires the isolated device planner' ./gradlew :app:assembleDebug -PlifeguideDevicePlanner=false --console=plain
85 expect_refusal 'requires its matching defines and entry point' ./gradlew :app:assembleDebug --console=plain
86 expect_refusal 'cannot be packaged as a user application' ./gradlew :app:assembleDebug -PlifeguidePersonalRecoveryQa=false -Ptarget=tool/personal_recovery_fixture.dart -Pdart-defines="$defines" --console=plain
87 expect_refusal 'debug-only initial edition' ./gradlew :app:assembleRelease -Ptarget=tool/personal_recovery_fixture.dart -Pdart-defines="$defines" --console=plain
88 for task in :app:installDebug :app:packageDebug :app:build; do
89 expect_refusal 'request assembleDebug explicitly' ./gradlew "$task" -Ptarget=tool/personal_recovery_fixture.dart -Pdart-defines="$defines" --console=plain
90 done
91 expect_refusal 'versions 10 and 11' bash -c 'cd ..; flutter build apk --debug --target=tool/personal_recovery_fixture.dart --dart-define=LIFEGUIDE_STANDALONE=true --dart-define=LIFEGUIDE_PERSONAL_RECOVERY_QA=true --build-number=12 --build-name=0.7.2-recovery-qa.12'
92 - name: Enable KVM for a newly created synthetic SDK emulator
93 run: |
94 test -c /dev/kvm
95 echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
96 sudo udevadm control --reload-rules
97 sudo udevadm trigger --name-match=kvm
98 - name: Exact old install, side-by-side recovery and new-app upgrade
99 uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d
100 with:
101 api-level: 35
102 target: google_apis
103 arch: x86_64
104 profile: pixel_6
105 emulator-port: 5554
106 avd-name: lifeguide-recovery-synthetic
107 force-avd-creation: true
108 emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -wipe-data -noaudio -no-boot-anim -camera-back none
109 working-directory: apps/lifemate
110 script: python tool/test_personal_recovery_android.py --serial emulator-5554 --original-apk build/original-delivered/LifeGuide.apk --qa-apk build/recovery-qa-10.apk --upgrade-apk build/recovery-qa-11.apk --acknowledge-synthetic-emulator-only --output exports/personal-recovery-android.json
111 - name: Preserve only sanitized receipts and fictional screenshots
112 if: always()
113 uses: actions/upload-artifact@v4
114 with:
115 name: LifeGuide-synthetic-Android-recovery-verification
116 path: |
117 apps/lifemate/exports/personal-recovery-android.json
118 apps/lifemate/exports/*.png
119 if-no-files-found: warn
120 retention-days: 14
121 # No APK, SQLite, encrypted archive, private key or owner data is uploaded.