@@ -2,36 +2,79 @@ name: CI
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [main]
6
6
pull_request :
7
- branches : [ main ]
7
+ branches : [main]
8
+
9
+ permissions :
10
+ id-token : write
8
11
9
12
jobs :
10
- test :
13
+ setup :
11
14
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
+
12
33
steps :
13
34
- uses : actions/checkout@v4
14
- - name : Set up Python 3.12
35
+
36
+ - name : Set up Python
15
37
uses : actions/setup-python@v5
16
38
with :
17
39
python-version : ' 3.12'
40
+
18
41
- name : Install uv
19
42
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
+
26
52
- name : Install Playwright browsers
53
+ run : uv run playwright install --with-deps chromium
54
+
55
+ - name : Run tests with coverage [${{ matrix.name }}]
27
56
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()
34
72
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 }}
0 commit comments