-
-
Notifications
You must be signed in to change notification settings - Fork 347
102 lines (81 loc) · 2.56 KB
/
Copy pathe2e-tests.yml
File metadata and controls
102 lines (81 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: E2E Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
# Database
POSTGRES_URL: postgresql://testuser:testpass@localhost:5432/better_chatbot_test
# Authentication
BETTER_AUTH_SECRET: test-secret-key-for-ci-only-not-for-production-use
BETTER_AUTH_URL: http://localhost:3000
# Application
NEXT_PUBLIC_BASE_URL: http://localhost:3000
# LLM Provider (OpenRouter with free models)
OPENROUTER_API_KEY: ${{ secrets.E2E_OPENROUTER_API_KEY || 'test-key' }}
E2E_DEFAULT_MODEL: openRouter/gemini-2.0-flash-exp:free
# Feature flags
DISABLE_SIGN_UP: 0
DISABLE_EMAIL_SIGN_IN: 0
FILE_BASED_MCP_CONFIG: false
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
POSTGRES_DB: better_chatbot_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 10.2.1
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
run: pnpm playwright install chromium --with-deps
- name: Setup test environment
run: |
# Create minimal .env for Playwright (only non-runtime vars if needed)
touch .env
- name: Run database migrations
run: pnpm db:migrate
- name: Seed test users once before all tests
run: pnpm test:e2e:seed
- name: Build application
run: pnpm build:local
- name: Run E2E tests
run: pnpm test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30