Skip to content

Commit 345fae4

Browse files
committed
feat: consolidate 30 commits - improvements and fixes
1 parent a34927c commit 345fae4

File tree

10 files changed

+568
-209
lines changed

10 files changed

+568
-209
lines changed

.github/workflows/ci.yml

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,79 @@ name: CI
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
8+
9+
permissions:
10+
id-token: write
811

912
jobs:
10-
test:
13+
setup:
1114
runs-on: ubuntu-latest
15+
outputs:
16+
python-version: 3.12
17+
steps:
18+
- run: echo "Setup completed"
19+
20+
test-matrix:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
name: [workflow, integration, unit]
25+
include:
26+
- name: unit
27+
test_file: test_browser_fastmcp_client.py
28+
- name: integration
29+
test_file: test_browser_test.py
30+
- name: workflow
31+
test_file: test_browser_workflow_test.py
32+
1233
steps:
1334
- uses: actions/checkout@v4
14-
- name: Set up Python 3.12
35+
36+
- name: Set up Python
1537
uses: actions/setup-python@v5
1638
with:
1739
python-version: '3.12'
40+
1841
- name: Install uv
1942
run: pip install uv
20-
- name: Install project dependencies
21-
run: uv sync
22-
- name: Ensure all dependencies (including test/dev) are installed
23-
run: uv sync --dev
24-
- name: Install test dependencies (force ensure)
25-
run: uv pip install pytest pytest-asyncio pytest-cov coverage
43+
44+
- name: Set environment variables
45+
run: |
46+
echo "UV_HTTP_TIMEOUT=120" >> $GITHUB_ENV
47+
echo 'PW_CHROMIUM_ARGS=--no-sandbox --disable-dev-shm-usage --disable-gpu --single-process' >> $GITHUB_ENV
48+
49+
- name: Install dependencies
50+
run: uv sync --all-extras
51+
2652
- name: Install Playwright browsers
53+
run: uv run playwright install --with-deps chromium
54+
55+
- name: Run tests with coverage [${{ matrix.name }}]
2756
run: |
28-
uv run playwright install --with-deps chromium
29-
echo 'PW_CHROMIUM_ARGS=--no-sandbox' >> $GITHUB_ENV
30-
- name: Run tests with coverage
31-
run: uv run python -m pytest --cov=browser_fastmcp_server.py --cov=main.py --cov-report=xml --cov-report=term test_browser_workflow_test.py test_browser_test.py test_browser_fastmcp_client.py
32-
- name: Upload coverage to Codecov
33-
uses: codecov/codecov-action@v4
57+
export PYTEST_ADDOPTS="--durations=10 --tb=short"
58+
uv run python -m pytest \
59+
--cov=browser_fastmcp_server \
60+
--cov=main \
61+
--cov-report=xml \
62+
--cov-report=term \
63+
--reruns 3 \
64+
--reruns-delay 20 \
65+
${{ matrix.test_file }} \
66+
-v \
67+
--maxfail=1
68+
69+
- name: Upload coverage to Codecov [${{ matrix.name }}]
70+
uses: codecov/codecov-action@v5
71+
if: always()
3472
with:
35-
files: ./coverage.xml
36-
fail_ci_if_error: true
37-
token: ${{ secrets.CODECOV_TOKEN }}
73+
token: ${{ secrets.CODECOV_TOKEN }}
74+
slug: Euraxluo/browser-mcp
75+
file: ./coverage.xml
76+
flags: ${{ matrix.name }}
77+
name: ${{ matrix.name }}
78+
verbose: true
79+
env:
80+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM python:3.12-slim
33
WORKDIR /app
44

55
COPY pyproject.toml uv.lock ./
6-
RUN pip install uv && uv sync
6+
RUN pip install uv && uv sync --all-extras
77
RUN uv run playwright install --with-deps chromium
88

99
COPY . .

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Session-Based Browser-Use FastMCP Server
22

3-
[![CI](https://github.com/${{github.repository}}/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/${{github.repository}}/actions/workflows/ci.yml)
4-
[![codecov](https://codecov.io/gh/${{github.repository}}/branch/main/graph/badge.svg)](https://codecov.io/gh/${{github.repository}})
3+
[![CI](https://github.com/Euraxluo/browser-mcp/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Euraxluo/browser-mcp/actions/workflows/ci.yml)
4+
[![codecov](https://codecov.io/gh/Euraxluo/browser-mcp/branch/main/graph/badge.svg)](https://codecov.io/gh/Euraxluo/browser-mcp)
55

66
[English](#english) | [中文](#chinese)
77

@@ -39,7 +39,7 @@ A modern Model Context Protocol (MCP) server that provides advanced browser auto
3939

4040
2. **Install the Browser**:
4141
```bash
42-
playwright install chromium --with-deps --no-shell
42+
uv run playwright install --with-deps chromium
4343
```
4444

4545
3. **Start the Server**:

0 commit comments

Comments
 (0)