Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

e2e-tests.yml

77 lines1.9 KB

1name: E2E Tests
2​
3on:
4 push:
5 branches: [main]
6 pull_request:
7​
8jobs:
9 e2e-tests:
10 name: Run E2E Tests
11 runs-on: ubuntu-latest
12 timeout-minutes: 10
13​
14 steps:
15 - name: Checkout code
16 uses: actions/checkout@v6.0.1
17​
18 - name: Setup pnpm
19 uses: pnpm/action-setup@v4
20 with:
21 version: 10.27.0
22​
23 - name: Setup Node.js
24 uses: actions/setup-node@v4
25 with:
26 node-version: '20'
27 cache: 'pnpm'
28​
29 - name: Install dependencies
30 run: pnpm install --frozen-lockfile
31​
32 - name: Start Docker services
33 run: |
34 cd packages/db-collection-e2e/docker
35 docker compose up -d
36 echo "Waiting for services to be healthy..."
37 timeout 60 bash -c 'until docker compose ps | grep -q "healthy"; do sleep 2; done'
38​
39 - name: Build packages
40 run: |
41 pnpm --filter @tanstack/db-ivm build
42 pnpm --filter @tanstack/db build
43 pnpm --filter @tanstack/electric-db-collection build
44 pnpm --filter @tanstack/query-db-collection build
45​
46 - name: Run Electric E2E tests
47 run: |
48 cd packages/electric-db-collection
49 pnpm test:e2e
50 env:
51 ELECTRIC_URL: http://localhost:3000
52 POSTGRES_HOST: localhost
53 POSTGRES_PORT: 54321
54 POSTGRES_USER: postgres
55 POSTGRES_PASSWORD: password
56 POSTGRES_DB: e2e_test
57​
58 - name: Run Query E2E tests
59 run: |
60 cd packages/query-db-collection
61 pnpm test:e2e
62 env:
63 ELECTRIC_URL: http://localhost:3000
64​
65 - name: Stop Docker services
66 if: always()
67 run: |
68 cd packages/db-collection-e2e/docker
69 docker compose down -v
70​
71 - name: Upload test results
72 if: failure()
73 uses: actions/upload-artifact@v4
74 with:
75 name: test-results
76 path: packages/db-collection-e2e/junit/
77 retention-days: 7