LifeMate — Personal, Family & Learning Companion

phase-4/ai-learning-wellbeing
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 95 lines 3.62 KB
Raw
1 name: LifeMate CI
2
3 on:
4 push:
5 branches: [main]
6 pull_request:
7
8 permissions:
9 contents: read
10
11 jobs:
12 security:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v4
16 - name: Reject committed environment files
17 run: |
18 bad_files=$(find . -type f \( -name '.env' -o -name '.env.*' \) ! -name '.env.example' ! -path './.git/*')
19 if [ -n "$bad_files" ]; then
20 echo "Committed environment files detected:"
21 echo "$bad_files"
22 exit 1
23 fi
24 - name: Scan high-confidence secret patterns
25 run: |
26 if git grep -I -n -E '(-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----|AKIA[0-9A-Z]{16}|gh[pousr]_[A-Za-z0-9_]{30,}|sk_live_[A-Za-z0-9]{20,})' -- .; then
27 echo "Potential committed secret detected."
28 exit 1
29 fi
30
31 flutter:
32 runs-on: ubuntu-latest
33 defaults:
34 run:
35 working-directory: apps/lifemate
36 steps:
37 - uses: actions/checkout@v4
38 - uses: subosito/flutter-action@v2
39 with:
40 channel: stable
41 cache: true
42 - run: flutter pub get
43 - run: dart format lib test
44 - run: flutter analyze
45 - run: flutter test
46 - run: flutter build web --release
47 - run: flutter build apk --debug
48
49 backend:
50 runs-on: ubuntu-latest
51 services:
52 postgres:
53 image: postgres:17
54 env:
55 POSTGRES_PASSWORD: lifemate_ci
56 POSTGRES_DB: lifemate_ci
57 ports: ['5432:5432']
58 options: >-
59 --health-cmd "pg_isready -U postgres -d lifemate_ci"
60 --health-interval 5s --health-timeout 5s --health-retries 10
61 env:
62 PGPASSWORD: lifemate_ci
63 DATABASE_URL: postgresql://postgres:lifemate_ci@localhost:5432/lifemate_ci
64 JWT_SECRET: ci-only-secret-ci-only-secret-ci-only-secret
65 NODE_ENV: test
66 steps:
67 - uses: actions/checkout@v4
68 - uses: actions/setup-node@v4
69 with:
70 node-version: 22
71 - name: Apply migrations
72 run: |
73 for migration in backend/migrations/*.sql; do
74 echo "Applying $migration"
75 psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f "$migration"
76 done
77 - name: Database authorization tests
78 run: |
79 psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/schema_test.sql
80 psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/phase3_schema_test.sql
81 if [ -f backend/tests/phase4_schema_test.sql ]; then
82 psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/phase4_schema_test.sql
83 fi
84 - name: Install backend
85 working-directory: backend
86 run: npm install
87 - name: Backend dependency audit
88 working-directory: backend
89 run: npm audit --audit-level=high
90 - name: Backend tests
91 working-directory: backend
92 run: npm test
93 - name: Verify schema objects
94 run: |
95 test "$(psql -h localhost -U postgres -d lifemate_ci -Atc "select count(*) from information_schema.tables where table_schema='public' and table_name in ('app_user','profile','family_workspace','family_membership','guardian_relationship','family_invitation','access_audit','auth_credential','auth_token','auth_session','life_context','academic_year','academic_term','subject','class_session','plan_item','sharing_grant','reminder','notification_preference','notification_outbox','sync_mutation','learning_goal','learning_checkin','wellbeing_checkin','ai_guide_session','ai_guide_message','ai_plan_proposal','wellbeing_safety_event');")" = "28"