This repository was archived by the owner on Jun 7, 2026. It is now read-only.
Repository navigation
123 lines (103 loc) · 3.66 KB
/
Copy pathpython-test.yml
File metadata and controls
123 lines (103 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Python Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
# Combined test and quality job - reduces job overhead while maintaining parallelism
test-and-quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group: [tests, quality]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv with caching
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: false
- name: Install dependencies
run: |
uv sync --frozen
uv pip install -e ".[dev]"
# Run core tests (unit, integration, metrics)
- name: Run core test suite
if: matrix.group == 'tests'
working-directory: .
run: |
uv run pytest --ignore=.venv --ignore=.pytest_cache --ignore=build --ignore=dist tests/unit/ tests/integration/ tests/test_metrics.py --cov=document_mcp --cov=src --cov-report=xml --cov-report=term-missing -v --tb=short --strict-markers --disable-warnings
# Run E2E and Evaluation tests if API keys available
- name: Run E2E and Evaluation tests
if: matrix.group == 'tests'
working-directory: .
run: |
uv run pytest --ignore=.venv --ignore=.pytest_cache --ignore=build --ignore=dist tests/e2e/ tests/evaluation/ --cov=document_mcp --cov=src --cov-report=xml --cov-report=term-missing -v --tb=short --strict-markers --disable-warnings --timeout=600
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# Code quality checks
- name: Run ruff linting
if: matrix.group == 'quality'
continue-on-error: true
run: uv run ruff check --output-format=github
- name: Run ruff format check
if: matrix.group == 'quality'
continue-on-error: true
run: uv run ruff format --check
- name: Run type checking
if: matrix.group == 'quality'
continue-on-error: true
run: uv run mypy document_mcp/
# Package validation
- name: Validate package build
if: matrix.group == 'quality'
run: |
uv build
echo "✅ Package builds successfully"
- name: Upload coverage to Codecov
if: matrix.group == 'tests'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
# Note: Release is handled by release.yml (triggered by version tags)
# This workflow focuses on testing only
# Minimal cross-platform validation (only if main tests pass)
cross-platform-check:
needs: test-and-quality
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: false
- name: Install dependencies
run: |
uv sync --frozen
uv pip install -e ".[dev]"
# Run only core tests (skip E2E for cross-platform)
- name: Run core tests
working-directory: .
run: |
uv run pytest --ignore=.venv --ignore=.pytest_cache --ignore=build --ignore=dist tests/unit/ tests/integration/ tests/test_metrics.py -v --tb=short --strict-markers --disable-warnings