Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,44 @@ jobs:
if: steps.check.outputs.affected == 'true'
run: pnpm nx run cli:e2e

# ─────────────────────────────────────── 2c. CLIENT E2E ──────────────────────────────────────
client-e2e:
runs-on: ubuntu-latest
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/setup
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
atlas-cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN }}

- name: Check if client is affected
id: check
run: |
if pnpm nx show projects --affected --base=origin/main --head=HEAD | grep -q "^client$"; then
echo "affected=true" >> $GITHUB_OUTPUT
echo "client is affected, running e2e tests"
else
echo "affected=false" >> $GITHUB_OUTPUT
echo "client not affected, skipping e2e tests"
fi

- name: Pre-start Supabase
if: steps.check.outputs.affected == 'true'
run: ./scripts/ci-prestart-supabase.sh client

- name: Run client e2e tests
if: steps.check.outputs.affected == 'true'
run: pnpm nx run client:e2e

# ────────────────────────────────── 3. DEPLOY WEBSITE (PREVIEW) ───────────────────────────
deploy-website:
if: github.event_name == 'pull_request'
needs: [build-and-test, edge-worker-e2e, cli-e2e]
needs: [build-and-test, edge-worker-e2e, cli-e2e, client-e2e]
runs-on: ubuntu-latest
environment: preview
env:
Expand Down Expand Up @@ -188,7 +222,7 @@ jobs:
# ────────────────────────────────── 4. DEPLOY DEMO ───────────────────────────
deploy-demo:
if: false # temporarily disabled
needs: [build-and-test, edge-worker-e2e, cli-e2e]
needs: [build-and-test, edge-worker-e2e, cli-e2e, client-e2e]
runs-on: ubuntu-latest
environment: ${{ github.event_name == 'pull_request' && 'preview' || 'production' }}
env:
Expand Down
19 changes: 2 additions & 17 deletions pkgs/client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"parallel": false
}
},
"test:integration": {
"e2e": {
"executor": "nx:run-commands",
"local": true,
"cache": false,
Expand All @@ -164,25 +164,10 @@
"parallel": false
}
},
"test:vitest": {
"executor": "nx:run-commands",
"local": true,
"cache": false,
"dependsOn": ["supabase:prepare", "build"],
"options": {
"cwd": "{projectRoot}",
"commands": [
"../../scripts/supabase-start-locked.sh .",
"psql 'postgresql://postgres:postgres@localhost:50522/postgres' -c 'SELECT pgflow_tests.reset_db()'",
"vitest run __tests__/ --config vitest.e2e.config.ts --poolOptions.threads.singleThread"
],
"parallel": false
}
},
"test": {
"executor": "nx:noop",
"inputs": ["default", "^production"],
"dependsOn": ["test:vitest", "test:types"]
"dependsOn": ["test:unit", "test:types"]
},
"benchmark": {
"executor": "nx:run-commands",
Expand Down
Loading