LifeMate — Personal, Family & Learning Companion
ci: exercise identity API and full schema
davoodmehraban89 committed
Oct 5, 2026 at 07:32 UTC
913c8cc9516fdb22f9d77db02a70283ad5f832dc
1 file changed
+23
-11
.github/workflows/ci.yml
+23
-11
@@ -23,14 +23,13 @@ jobs:
23
- name: Generate platform scaffold
24
run: flutter create --platforms=android,web --project-name=lifemate .
25
- run: flutter pub get
26
- - name: Format
27
- run: dart format --output=none --set-exit-if-changed lib test
26
+ - run: dart format --output=none --set-exit-if-changed lib test
27
- run: flutter analyze
28
- run: flutter test
29
- run: flutter build web --release
30
- run: flutter build apk --debug
31
33
- postgres:
32
+ backend:
33
runs-on: ubuntu-latest
34
services:
35
postgres:
@@ -38,21 +37,34 @@ jobs:
37
env:
38
POSTGRES_PASSWORD: lifemate_ci
39
POSTGRES_DB: lifemate_ci
41
- ports:
42
- - 5432:5432
40
+ ports: ['5432:5432']
41
options: >-
42
--health-cmd "pg_isready -U postgres -d lifemate_ci"
45
- --health-interval 5s
46
- --health-timeout 5s
47
- --health-retries 10
43
+ --health-interval 5s --health-timeout 5s --health-retries 10
44
env:
45
PGPASSWORD: lifemate_ci
46
+ DATABASE_URL: postgresql://postgres:lifemate_ci@localhost:5432/lifemate_ci
47
+ JWT_SECRET: ci-only-secret-ci-only-secret-ci-only-secret
48
+ NODE_ENV: test
49
steps:
50
- uses: actions/checkout@v4
51
+ - uses: actions/setup-node@v4
52
+ with:
53
+ node-version: 22
54
+ cache: npm
55
+ cache-dependency-path: backend/package-lock.json
56
- name: Apply migrations
53
- run: psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/migrations/0001_identity_family.sql
54
- - name: Authorization/schema tests
57
+ run: |
58
+ psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/migrations/0001_identity_family.sql
59
+ psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/migrations/0002_auth.sql
60
+ - name: Database authorization tests
61
run: psql -h localhost -U postgres -d lifemate_ci -v ON_ERROR_STOP=1 -f backend/tests/schema_test.sql
62
+ - name: Install backend
63
+ working-directory: backend
64
+ run: npm install --package-lock-only && npm ci
65
+ - name: Load API module
66
+ working-directory: backend
67
+ run: node -e "import('./src/server.js').then(() => console.log('identity API loaded'))"
68
- name: Verify schema objects
69
run: |
58
- 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');")" = "7"
70
+ 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');")" = "10"