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
71 changes: 71 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,77 @@ jobs:
APP_NAME: ${{ matrix.app.name }}
DEPLOYMENT_URL: "http://localhost:${{ matrix.app.name == 'sveltekit' && '4173' || '3000' }}"

e2e-local-postgres:
name: E2E Local Postgres Tests (${{ matrix.app.name }} - ${{ matrix.app.canary && 'canary' || 'stable' }})
runs-on: ubuntu-latest
needs: getTestMatrix
strategy:
fail-fast: false
matrix: ${{fromJson(needs.getTestMatrix.outputs.matrix)}}

services:
postgres:
image: postgres:18-alpine
env:
POSTGRES_USER: world
POSTGRES_PASSWORD: world
POSTGRES_DB: world
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
WORKFLOW_TARGET_WORLD: "@workflow/world-postgres"
WORKFLOW_POSTGRES_URL: "postgres://world:world@localhost:5432/world"

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 10.14.0

- name: Setup Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "pnpm"

- name: Setup canary
if: ${{ matrix.app.canary }}
run: |
cat packages/next/package.json | jq '.dependencies.next|="canary"' > packages/next/package.json.new && mv packages/next/package.json.new packages/next/package.json
cat workbench/${{ matrix.app.name }}/package.json | jq '.dependencies.next|="canary"' > workbench/${{ matrix.app.name }}/package.json.new && mv workbench/${{ matrix.app.name }}/package.json.new workbench/${{ matrix.app.name }}/package.json
pnpm install --no-frozen-lockfile

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Run Initial Build
run: pnpm turbo run build --filter='!./workbench/*'

- name: Setup PostgreSQL Database
run: ./packages/world-postgres/bin/setup.js

- name: Run Build Tests
run: pnpm vitest run packages/core/e2e/local-build.test.ts
env:
APP_NAME: ${{ matrix.app.name }}

- name: Run E2E Tests
run: cd workbench/${{ matrix.app.name }} && pnpm start & echo "starting tests in 10 seconds" && sleep 10 && pnpm run test:e2e
env:
APP_NAME: ${{ matrix.app.name }}
DEPLOYMENT_URL: "http://localhost:${{ matrix.app.name == 'sveltekit' && '4173' || '3000' }}"

e2e-windows:
name: E2E Windows Tests
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion packages/world-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"./migrations/*.sql": "./src/drizzle/migrations/*.sql"
},
"scripts": {
"build": "tsc",
"build": "tsc && chmod +x bin/setup.js",
"dev": "tsc --watch",
"clean": "tsc --build --clean && rm -rf dist",
"test": "vitest run",
Expand Down
Loading