feat(mcp): scaffold api/mcp module (T1 #648) #1163
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 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@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 | |
| with: | |
| name: failed-test-screenshots-shard-${{ matrix.shard }} | |
| path: playwright-report/artifacts/ | |
| retention-days: 30 |