44 branches : [ main, staging ]
55 pull_request :
66 branches : [ main, staging ]
7+
8+ concurrency :
9+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+ cancel-in-progress : true
11+
712jobs :
813 test :
914 timeout-minutes : 60
1015 runs-on : ubuntu-latest
16+ env :
17+ PYTHONPATH : ${{ github.workspace }}
1118 strategy :
1219 fail-fast : false
1320 matrix :
@@ -18,18 +25,27 @@ jobs:
1825 ports :
1926 - 6379:6379
2027 steps :
21- - uses : actions/checkout@v4
28+ - uses : actions/checkout@v6
2229
23- - uses : actions/setup-node@v4
30+ - uses : actions/setup-node@v6
2431 with :
2532 node-version : 24
33+ cache : ' npm'
34+ cache-dependency-path : |
35+ package-lock.json
36+ app/package-lock.json
2637
27- - uses : actions/setup-python@v5
38+ - uses : actions/setup-python@v6
2839 with :
2940 python-version : ' 3.12'
3041
42+ - name : Install uv
43+ uses : astral-sh/setup-uv@v7
44+ with :
45+ version : " latest"
46+
3147 - name : Install backend dependencies
32- run : pip install -e .
48+ run : uv sync
3349
3450 - name : Install frontend dependencies
3551 working-directory : ./app
@@ -42,32 +58,61 @@ jobs:
4258 run : npm run build
4359
4460 - name : Seed test data into FalkorDB
45- run : python e2e/seed_test_data.py
61+ run : uv run python e2e/seed_test_data.py
4662
47- - name : Install Playwright
63+ - name : Install Playwright npm dependencies
4864 run : |
4965 npm ci
50- npx playwright install --with-deps
5166
52- - name : Run Playwright tests
67+ - name : Cache Playwright browsers
68+ id : playwright-cache
69+ uses : actions/cache@v5
70+ with :
71+ path : ~/.cache/ms-playwright
72+ key : playwright-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package-lock.json') }}
73+
74+ - name : Install Playwright browsers
75+ if : steps.playwright-cache.outputs.cache-hit != 'true'
76+ run : npx playwright install --with-deps chromium firefox
77+
78+ - name : Install Playwright system deps
79+ if : steps.playwright-cache.outputs.cache-hit == 'true'
80+ run : |
81+ npx playwright install chromium firefox
82+ npx playwright install-deps chromium firefox
83+
84+ - name : Start server
85+ id : start-server
5386 env :
5487 OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
5588 SECRET_TOKEN : ${{ secrets.SECRET_TOKEN }}
5689 CODE_GRAPH_PUBLIC : " 1"
5790 MODEL_NAME : " openai/gpt-4.1-mini"
5891 run : |
59- flask --app api/index.py run --host 0.0.0.0 --port 5000 &
60- # Wait for Flask to be ready
92+ uv run uvicorn api.index:app --host 0.0.0.0 --port 5000 &
93+ echo "pid=$!" >> "$GITHUB_OUTPUT"
94+ # Wait for server to be ready
6195 timeout 30 bash -c 'until curl -s http://localhost:5000/ > /dev/null 2>&1; do sleep 0.5; done'
62- npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
96+
97+ - name : Run Playwright tests
98+ env :
99+ OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
100+ SECRET_TOKEN : ${{ secrets.SECRET_TOKEN }}
101+ CODE_GRAPH_PUBLIC : " 1"
102+ MODEL_NAME : " openai/gpt-4.1-mini"
103+ run : npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
104+
105+ - name : Stop server
106+ if : always()
107+ run : kill ${{ steps.start-server.outputs.pid }} 2>/dev/null || true
63108
64109 - name : Ensure required directories exist
65110 if : always()
66111 run : |
67112 mkdir -p playwright-report
68113 mkdir -p playwright-report/artifacts
69114
70- - uses : actions/upload-artifact@v4
115+ - uses : actions/upload-artifact@v7
71116 if : always()
72117 with :
73118 name : playwright-report-shard-${{ matrix.shard }}
76121
77122 - name : Upload failed test screenshots
78123 if : always()
79- uses : actions/upload-artifact@v4
124+ uses : actions/upload-artifact@v7
80125 with :
81126 name : failed-test-screenshots-shard-${{ matrix.shard }}
82127 path : playwright-report/artifacts/
0 commit comments