LifeMate — Personal, Family & Learning Companion
ci: retain installable final release artifacts
davoodmehraban89 committed
Oct 5, 2026 at 19:45 UTC
7eaa5a5e0c66e636a613c74d2bcf5cd755a62d13
1 file changed
+19
-18
.github/workflows/ci.yml
+19
-18
@@ -16,17 +16,10 @@ jobs:
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
19
+ if [ -n "$bad_files" ]; then echo "Committed environment files detected:"; echo "$bad_files"; exit 1; fi
20
- name: Scan high-confidence secret patterns
21
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
22
+ 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 echo "Potential committed secret detected."; exit 1; fi
23
24
flutter:
25
runs-on: ubuntu-latest
@@ -51,7 +44,19 @@ jobs:
44
grep -q 'dir="rtl"' web/index.html
45
test -f web/manifest.json
46
- run: flutter build web --release
54
- - run: flutter build apk --debug
47
+ - run: flutter build apk --release
48
+ - name: Upload Web release
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: lifemate-web-release
52
+ path: apps/lifemate/build/web
53
+ if-no-files-found: error
54
+ - name: Upload Android APK
55
+ uses: actions/upload-artifact@v4
56
+ with:
57
+ name: lifemate-android-apk
58
+ path: apps/lifemate/build/app/outputs/flutter-apk/app-release.apk
59
+ if-no-files-found: error
60
61
backend:
62
runs-on: ubuntu-latest
@@ -77,17 +82,13 @@ jobs:
82
node-version: 22
83
- name: Apply migrations
84
run: |
80
- for migration in backend/migrations/*.sql; do
81
- echo "Applying $migration"
82
- psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f "$migration"
83
- done
85
+ for migration in backend/migrations/*.sql; do echo "Applying $migration"; psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f "$migration"; done
86
- name: Database authorization tests
87
run: |
88
psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/schema_test.sql
89
psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/phase3_schema_test.sql
88
- if [ -f backend/tests/phase4_schema_test.sql ]; then
89
- psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/phase4_schema_test.sql
90
- fi
90
+ if [ -f backend/tests/phase4_schema_test.sql ]; then psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/phase4_schema_test.sql; fi
91
+ if [ -f backend/tests/phase6_schema_test.sql ]; then psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/phase6_schema_test.sql; fi
92
- name: Install backend
93
working-directory: backend
94
run: npm install
@@ -102,7 +103,7 @@ jobs:
103
run: npm run check
104
- name: Verify schema objects
105
run: |
105
- 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"
106
+ 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','education_profile','curriculum_subject','textbook_catalog','iran_calendar_event','menstrual_cycle_entry');")" = "33"
107
- name: Backup and restore drill
108
run: |
109
psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/scripts/restore-smoke.sql