@davoodmehraban89 / Factor-easy / commits / 2919748
Fork 0

سامانه صدور فاکتور و حسابداری

ci: add free local Supabase WP2 E2E workflow

davoodmehraban89 committed Nov 16, 2026 at 13:56 UTC 29197487f87ff3b6ac369d8b5df4a2167d2c0f31
1 file changed +72
.github/workflows/free-supabase-local-e2e.yml new
+72
@@ -0,0 +1,72 @@
1 +name: Free Supabase Local WP2 E2E
2 +
3 +on:
4 + pull_request:
5 + paths:
6 + - "supabase/**"
7 + - "js/journal-rpc.js"
8 + - "js/journal-ui.js"
9 + - "scripts/journal-rpc-adapter.test.mjs"
10 + - ".github/workflows/free-supabase-local-e2e.yml"
11 + - "supabase/config.toml"
12 + workflow_dispatch:
13 +
14 +permissions:
15 + contents: read
16 +
17 +concurrency:
18 + group: free-supabase-local-e2e-${{ github.ref }}
19 + cancel-in-progress: true
20 +
21 +jobs:
22 + local-supabase:
23 + runs-on: ubuntu-24.04
24 + timeout-minutes: 45
25 + steps:
26 + - uses: actions/checkout@v4
27 +
28 + - uses: actions/setup-node@v4
29 + with:
30 + node-version: "22"
31 +
32 + - uses: supabase/setup-cli@v1
33 + with:
34 + version: latest
35 +
36 + - name: Start disposable local Supabase stack
37 + run: supabase start -x studio,imgproxy,logflare,vector,analytics
38 +
39 + - name: Apply the repository migration chain
40 + run: supabase db reset
41 +
42 + - name: Capture local Supabase endpoints (no secrets uploaded)
43 + run: |
44 + supabase status
45 + supabase status -o env > /tmp/supabase-local.env
46 + grep -E '^(API_URL|DB_URL|STUDIO_URL)=' /tmp/supabase-local.env || true
47 +
48 + - name: Verify WP1/WP2 journal RPC surface exists
49 + run: |
50 + set -a
51 + . /tmp/supabase-local.env
52 + set +a
53 + psql "$DB_URL" -v ON_ERROR_STOP=1 -Atc "
54 + select
55 + to_regprocedure('public.finora_journal_create_draft(uuid,text,jsonb,jsonb)') is not null,
56 + to_regprocedure('public.finora_journal_update_draft(uuid,text,bigint,jsonb,jsonb)') is not null,
57 + to_regprocedure('public.finora_journal_post(uuid,text,bigint)') is not null;
58 + " | grep -Fx 't|t|t'
59 +
60 + - name: Run journal RPC adapter contract tests
61 + run: node --test scripts/journal-rpc-adapter.test.mjs
62 +
63 + - name: Upload local Supabase diagnostics on failure
64 + if: failure()
65 + run: |
66 + supabase status || true
67 + docker ps -a || true
68 + docker compose ls || true
69 +
70 + - name: Stop disposable local Supabase stack
71 + if: always()
72 + run: supabase stop --no-backup || true