-
Notifications
You must be signed in to change notification settings - Fork 49
128 lines (109 loc) · 3.78 KB
/
playwright.yml
File metadata and controls
128 lines (109 loc) · 3.78 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Playwright Tests
on:
push:
branches: [ main, staging ]
pull_request:
branches: [ main, staging ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
PYTHONPATH: ${{ github.workspace }}
strategy:
fail-fast: false
matrix:
shard: [1, 2]
services:
falkordb:
image: falkordb/falkordb:latest
ports:
- 6379:6379
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: 'npm'
cache-dependency-path: |
package-lock.json
app/package-lock.json
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "latest"
- name: Install backend dependencies
run: uv sync --all-extras
- name: Install frontend dependencies
working-directory: ./app
run: npm ci
- name: Build frontend
working-directory: ./app
env:
VITE_SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
run: npm run build
- name: Seed test data into FalkorDB
run: uv run python e2e/seed_test_data.py
- name: Install Playwright npm dependencies
run: |
npm ci
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium firefox
- name: Install Playwright system deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: |
npx playwright install chromium firefox
npx playwright install-deps chromium firefox
- name: Start server
id: start-server
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
CODE_GRAPH_PUBLIC: "1"
MODEL_NAME: "openai/gpt-4.1-mini"
run: |
uv run uvicorn api.index:app --host 0.0.0.0 --port 5000 &
echo "pid=$!" >> "$GITHUB_OUTPUT"
# Wait for server to be ready
timeout 30 bash -c 'until curl -s http://localhost:5000/ > /dev/null 2>&1; do sleep 0.5; done'
- name: Run Playwright tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
CODE_GRAPH_PUBLIC: "1"
MODEL_NAME: "openai/gpt-4.1-mini"
run: npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
- name: Stop server
if: always()
run: kill ${{ steps.start-server.outputs.pid }} 2>/dev/null || true
- name: Ensure required directories exist
if: always()
run: |
mkdir -p playwright-report
mkdir -p playwright-report/artifacts
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: always()
with:
name: playwright-report-shard-${{ matrix.shard }}
path: playwright-report/
retention-days: 30
- name: Upload failed test screenshots
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: failed-test-screenshots-shard-${{ matrix.shard }}
path: playwright-report/artifacts/
retention-days: 30