Skip to content

Commit 1ea4670

Browse files
committed
docs: Add comprehensive guide for auto-compilation flow development and deployment strategies
1 parent 1e1477f commit 1ea4670

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3358
-509
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'pgflow': minor
3+
'@pgflow/edge-worker': minor
4+
---
5+
6+
Add auto-compilation flow and HTTP control plane server for edge worker

.github/workflows/ci.yml

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,8 @@ jobs:
4949
echo "NX_BASE=origin/main" >> $GITHUB_ENV
5050
echo "NX_HEAD=HEAD" >> $GITHUB_ENV
5151
52-
- name: Verify NX_BASE and NX_HEAD are set
53-
run: echo "BASE=$NX_BASE HEAD=$NX_HEAD"
54-
5552
- name: Pre-start Supabase for affected packages
56-
run: ./scripts/ci-prestart-supabase.sh core client
53+
run: ./scripts/ci-prestart-supabase.sh core client cli
5754

5855
- name: Quality gate (lint + typecheck + test)
5956
run: pnpm nx affected -t lint typecheck test --parallel --configuration=production --base="$NX_BASE" --head="$NX_HEAD"
@@ -96,30 +93,53 @@ jobs:
9693
echo "NX_BASE=origin/main" >> $GITHUB_ENV
9794
echo "NX_HEAD=HEAD" >> $GITHUB_ENV
9895
99-
- name: Verify NX_BASE and NX_HEAD are set
100-
run: echo "BASE=$NX_BASE HEAD=$NX_HEAD"
101-
10296
- name: Pre-start Supabase for affected packages
10397
run: ./scripts/ci-prestart-supabase.sh edge-worker
10498

105-
- name: Check if edge-worker e2e tests are affected
106-
id: check-affected
99+
- name: Run edge-worker e2e tests (if affected)
100+
run: pnpm nx affected -t test:e2e --projects=edge-worker --parallel --base="$NX_BASE" --head="$NX_HEAD"
101+
102+
# ─────────────────────────────────────── 2b. CLI E2E ──────────────────────────────────────
103+
cli-e2e:
104+
runs-on: ubuntu-latest
105+
env:
106+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
107+
steps:
108+
- uses: actions/checkout@v4
109+
with:
110+
fetch-depth: 0
111+
112+
- uses: ./.github/actions/setup
113+
114+
- name: Setup Deno
115+
uses: denoland/setup-deno@v2
116+
with:
117+
deno-version: '2.1.4'
118+
119+
- name: Install sqruff
120+
uses: ./.github/actions/setup-sqruff
121+
with:
122+
github-token: ${{ secrets.GITHUB_TOKEN }}
123+
124+
- name: Setup Atlas
125+
uses: ariga/setup-atlas@master
126+
with:
127+
cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN }}
128+
129+
- name: Set Nx base for affected commands
107130
run: |
108-
if pnpm nx show projects --affected -t test:e2e --base="$NX_BASE" --head="$NX_HEAD" | grep -q "^edge-worker$"; then
109-
echo "affected=true" >> $GITHUB_OUTPUT
110-
echo "Edge-worker e2e tests are affected by changes"
111-
else
112-
echo "affected=false" >> $GITHUB_OUTPUT
113-
echo "Edge-worker e2e tests are not affected by changes - skipping"
114-
fi
131+
echo "NX_BASE=origin/main" >> $GITHUB_ENV
132+
echo "NX_HEAD=HEAD" >> $GITHUB_ENV
115133
116-
- name: Run edge-worker e2e tests
117-
if: steps.check-affected.outputs.affected == 'true'
118-
run: pnpm nx affected -t test:e2e --parallel --base="$NX_BASE" --head="$NX_HEAD"
134+
- name: Pre-start Supabase for CLI
135+
run: ./scripts/ci-prestart-supabase.sh cli
136+
137+
- name: Run CLI e2e tests (if affected)
138+
run: pnpm nx affected -t test:e2e --projects=cli --base="$NX_BASE" --head="$NX_HEAD"
119139

120140
# ────────────────────────────────── 3. DEPLOY WEBSITE ───────────────────────────
121141
deploy-website:
122-
needs: [build-and-test, edge-worker-e2e]
142+
needs: [build-and-test, edge-worker-e2e, cli-e2e]
123143
runs-on: ubuntu-latest
124144
environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }}
125145
env:
@@ -142,9 +162,6 @@ jobs:
142162
echo "NX_BASE=origin/main" >> $GITHUB_ENV
143163
echo "NX_HEAD=HEAD" >> $GITHUB_ENV
144164
145-
- name: Verify NX_BASE and NX_HEAD are set
146-
run: echo "BASE=$NX_BASE HEAD=$NX_HEAD"
147-
148165
- name: Check if website is affected
149166
id: check-affected
150167
run: |
@@ -203,7 +220,7 @@ jobs:
203220
# ────────────────────────────────── 4. DEPLOY DEMO ───────────────────────────
204221
deploy-demo:
205222
if: false # temporarily disabled
206-
needs: [build-and-test, edge-worker-e2e]
223+
needs: [build-and-test, edge-worker-e2e, cli-e2e]
207224
runs-on: ubuntu-latest
208225
environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }}
209226
env:
@@ -224,9 +241,6 @@ jobs:
224241
echo "NX_BASE=origin/main" >> $GITHUB_ENV
225242
echo "NX_HEAD=HEAD" >> $GITHUB_ENV
226243
227-
- name: Verify NX_BASE and NX_HEAD are set
228-
run: echo "BASE=$NX_BASE HEAD=$NX_HEAD"
229-
230244
- name: Validate Supabase environment variables
231245
run: |
232246
if [ -z "$VITE_SUPABASE_URL" ]; then

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ deno-dist/
7272
.netlify
7373
.cursor/rules/nx-rules.mdc
7474
.github/instructions/nx.instructions.md
75+
config.toml.backup

0 commit comments

Comments
 (0)