Skip to content

Commit 28750e3

Browse files
committed
ci: add edge-worker integration tests to CI workflow (#498)
# Add Edge Worker Integration Tests to CI Pipeline This PR adds a dedicated CI job for running integration tests for the Edge Worker package. The new job: - Runs only when the edge-worker package is affected by changes - Executes before the website and demo deployment steps - Includes a pre-start Supabase script to prepare the testing environment Additionally, the PR updates the Edge Worker's project configuration to no longer include integration tests in the default test command, allowing them to be run separately in CI.
1 parent 9fe0b4d commit 28750e3

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,42 @@ jobs:
127127
if: steps.check.outputs.affected == 'true'
128128
run: pnpm nx run edge-worker:e2e
129129

130+
# ─────────────────────────────────────── 2a. EDGE-WORKER INTEGRATION ──────────────────────────────────────
131+
edge-worker-integration:
132+
needs: pre_job
133+
if: needs.pre_job.outputs.should_skip != 'true'
134+
runs-on: ubuntu-latest
135+
env:
136+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
137+
steps:
138+
- uses: actions/checkout@v4
139+
with:
140+
fetch-depth: 0
141+
142+
- uses: ./.github/actions/setup
143+
with:
144+
github-token: ${{ secrets.GITHUB_TOKEN }}
145+
atlas-cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN }}
146+
147+
- name: Check if edge-worker is affected
148+
id: check
149+
run: |
150+
if pnpm nx show projects --affected --base=origin/main --head=HEAD | grep -q "^edge-worker$"; then
151+
echo "affected=true" >> $GITHUB_OUTPUT
152+
echo "edge-worker is affected, running integration tests"
153+
else
154+
echo "affected=false" >> $GITHUB_OUTPUT
155+
echo "edge-worker not affected, skipping integration tests"
156+
fi
157+
158+
- name: Pre-start Supabase
159+
if: steps.check.outputs.affected == 'true'
160+
run: ./scripts/ci-prestart-supabase.sh edge-worker
161+
162+
- name: Run edge-worker integration tests
163+
if: steps.check.outputs.affected == 'true'
164+
run: pnpm nx run edge-worker:test:integration
165+
130166
# ─────────────────────────────────────── 2b. CLI E2E ──────────────────────────────────────
131167
cli-e2e:
132168
needs: pre_job
@@ -238,7 +274,7 @@ jobs:
238274
# ────────────────────────────────── 3. DEPLOY WEBSITE (PREVIEW) ───────────────────────────
239275
deploy-website:
240276
if: github.event_name == 'pull_request'
241-
needs: [build-and-test, edge-worker-e2e, cli-e2e, client-e2e, core-pgtap]
277+
needs: [build-and-test, edge-worker-e2e, edge-worker-integration, cli-e2e, client-e2e, core-pgtap]
242278
runs-on: ubuntu-latest
243279
environment: preview
244280
env:
@@ -280,7 +316,7 @@ jobs:
280316
# ────────────────────────────────── 4. DEPLOY DEMO ───────────────────────────
281317
deploy-demo:
282318
if: false # temporarily disabled
283-
needs: [build-and-test, edge-worker-e2e, cli-e2e, client-e2e, core-pgtap]
319+
needs: [build-and-test, edge-worker-e2e, edge-worker-integration, cli-e2e, client-e2e, core-pgtap]
284320
runs-on: ubuntu-latest
285321
environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }}
286322
env:

pkgs/edge-worker/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
},
189189
"test": {
190190
"inputs": ["default", "^production"],
191-
"dependsOn": ["test:types", "test:unit", "test:integration"]
191+
"dependsOn": ["test:types", "test:unit"]
192192
},
193193
"test:types": {
194194
"executor": "nx:run-commands",

0 commit comments

Comments
 (0)