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,39 +25,103 @@ jobs:
1825 ports :
1926 - 6379:6379
2027 steps :
21- - uses : actions/checkout@v4
22- - uses : actions/setup-node@v4
28+ - uses : actions/checkout@v6
29+
30+ - uses : actions/setup-node@v6
2331 with :
2432 node-version : 24
25- - name : Install dependencies
33+ cache : ' npm'
34+ cache-dependency-path : |
35+ package-lock.json
36+ app/package-lock.json
37+
38+ - uses : actions/setup-python@v6
39+ with :
40+ python-version : ' 3.12'
41+
42+ - name : Install uv
43+ uses : astral-sh/setup-uv@v7
44+ with :
45+ version : " latest"
46+
47+ - name : Install backend dependencies
48+ run : uv sync
49+
50+ - name : Install frontend dependencies
51+ working-directory : ./app
2652 run : npm ci
27- - name : Install Playwright Browsers
28- run : npx playwright install --with-deps
29- - name : Set up environment variables and run tests
53+
54+ - name : Build frontend
55+ working-directory : ./app
56+ env :
57+ VITE_SECRET_TOKEN : ${{ secrets.SECRET_TOKEN }}
58+ run : npm run build
59+
60+ - name : Seed test data into FalkorDB
61+ run : uv run python e2e/seed_test_data.py
62+
63+ - name : Install Playwright npm dependencies
64+ run : |
65+ npm ci
66+
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 Flask server
85+ id : start-server
3086 env :
31- FALKORDB_URL : ${{ secrets.FALKORDB_URL }}
3287 OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
3388 SECRET_TOKEN : ${{ secrets.SECRET_TOKEN }}
34- NEXT_PUBLIC_MODE : UNLIMITED
35- BACKEND_URL : ${{ secrets.BACKEND_URL }}
89+ CODE_GRAPH_PUBLIC : " 1 "
90+ MODEL_NAME : " openai/gpt-4.1-mini "
3691 run : |
37- npm install
38- npm run build
39- NEXTAUTH_SECRET=SECRET npm start & npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
92+ uv run flask --app api/index.py run --host 0.0.0.0 --port 5000 &
93+ echo "pid=$!" >> "$GITHUB_OUTPUT"
94+ # Wait for Flask to be ready
95+ timeout 30 bash -c 'until curl -s http://localhost:5000/ > /dev/null 2>&1; do sleep 0.5; done'
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 Flask server
106+ if : always()
107+ run : kill ${{ steps.start-server.outputs.pid }} 2>/dev/null || true
108+
40109 - name : Ensure required directories exist
41110 if : always()
42111 run : |
43112 mkdir -p playwright-report
44113 mkdir -p playwright-report/artifacts
45- - uses : actions/upload-artifact@v4
114+
115+ - uses : actions/upload-artifact@v7
46116 if : always()
47117 with :
48118 name : playwright-report-shard-${{ matrix.shard }}
49119 path : playwright-report/
50120 retention-days : 30
121+
51122 - name : Upload failed test screenshots
52123 if : always()
53- uses : actions/upload-artifact@v4
124+ uses : actions/upload-artifact@v7
54125 with :
55126 name : failed-test-screenshots-shard-${{ matrix.shard }}
56127 path : playwright-report/artifacts/
0 commit comments