-
Notifications
You must be signed in to change notification settings - Fork 15
218 lines (189 loc) · 7.81 KB
/
ci.yml
File metadata and controls
218 lines (189 loc) · 7.81 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: CI
permissions:
contents: write
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pydantic omegaconf hydra-core
pip install -e .
pip install -e ".[dev]"
pip install pytest pytest-cov
- name: Run tests with coverage (branch-specific)
run: |
# Run tests with branch-specific marker filtering
# For main branch: run all tests (including optional tests)
# For dev branch: exclude optional tests (docker, llm, performance, pydantic_ai)
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "Running all tests including optional tests for main branch"
pytest tests/ -m "not containerized" --cov=DeepResearch --cov-report=xml --cov-report=term-missing --junitxml=junit.xml -o junit_family=legacy
else
echo "Running tests excluding optional tests for dev branch"
pytest tests/ -m "not optional and not containerized" --cov=DeepResearch --cov-report=xml --cov-report=term-missing --junitxml=junit.xml -o junit_family=legacy
fi
- name: Run bioinformatics unit tests (all branches)
run: |
echo "Running bioinformatics unit tests..."
pytest tests/test_bioinformatics_tools/ -m "not containerized" --cov=DeepResearch --cov-append --cov-report=xml --cov-report=term-missing --junitxml=junit-bioinformatics.xml -o junit_family=legacy
- name: Run bioinformatics containerized tests (main branch only)
if: github.ref == 'refs/heads/docker'
run: |
echo "Running bioinformatics containerized tests..."
# Check if Docker is available and bioinformatics images exist
if docker --version >/dev/null 2>&1; then
make test-bioinformatics-containerized || echo "Containerized tests failed, but continuing..."
else
echo "Docker not available, skipping containerized tests"
fi
- name: Debug coverage files
run: |
echo "Checking for coverage files..."
ls -la coverage.xml junit.xml junit-bioinformatics.xml || echo "Some files missing"
head -20 coverage.xml || echo "Coverage file not readable"
# Codecov upload steps - These steps will NOT fail the CI even if uploads fail
# Tests will pass regardless of Codecov upload status
- name: Configure Codecov repository setup
run: |
# Check if CODECOV_TOKEN is available and set HAS_CODECOV_TOKEN flag
if [ -n "${CODECOV_TOKEN}" ]; then
echo "📊 Codecov token found - uploads will be enabled"
echo "🔗 Repository: ${{ github.repository }}"
echo "📈 Coverage reports will be uploaded to Codecov"
echo "✅ Codecov uploads enabled for this run"
echo "HAS_CODECOV_TOKEN=true" >> $GITHUB_ENV
else
echo "⚠️ CODECOV_TOKEN not found - uploads will be skipped"
echo "💡 To enable Codecov uploads:"
echo " 1. Go to https://codecov.io/gh/${{ github.repository }}/settings"
echo " 2. Generate a repository upload token"
echo " 3. Add it as CODECOV_TOKEN secret in repository settings"
echo " 4. Repository will be auto-detected on first upload"
echo "HAS_CODECOV_TOKEN=false" >> $GITHUB_ENV
fi
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Display coverage summary
run: |
echo "📈 Local Coverage Summary:"
echo "=========================="
if command -v coverage >/dev/null 2>&1; then
python -m coverage report --include="DeepResearch/*" --omit="*/tests/*,*/test_*" || echo "Coverage report generation failed"
else
echo "Coverage.py not available for summary"
fi
echo ""
echo "📁 Coverage files generated:"
ls -lh *.xml 2>/dev/null || echo "No XML coverage files found"
echo ""
echo "💡 To view detailed coverage: python -m coverage html && open htmlcov/index.html"
- name: Upload coverage to Codecov
if: env.HAS_CODECOV_TOKEN == 'true'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
slug: ${{ github.repository }}
name: "${{ github.ref_name }} - Python ${{ matrix.python-version || '3.11' }}"
continue-on-error: true
- name: Upload test results to Codecov
if: env.HAS_CODECOV_TOKEN == 'true' && !cancelled()
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./junit.xml
verbose: true
slug: ${{ github.repository }}
continue-on-error: true
- name: Upload bioinformatics test results to Codecov
if: env.HAS_CODECOV_TOKEN == 'true' && !cancelled()
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./junit-bioinformatics.xml
verbose: true
slug: ${{ github.repository }}
continue-on-error: true
- name: Codecov upload summary
if: env.HAS_CODECOV_TOKEN == 'false'
run: |
echo "ℹ️ Codecov uploads were skipped because CODECOV_TOKEN is not configured"
echo ""
echo "📋 Setup Instructions:"
echo "======================"
echo "1. Visit: https://codecov.io/gh/${{ github.repository }}"
echo "2. Sign in with GitHub"
echo "3. Repository should auto-appear"
echo "4. Go to Settings → Repository Upload Token"
echo "5. Generate and copy the token"
echo "6. Go to GitHub repo Settings → Secrets and variables → Actions"
echo "7. Add new repository secret: CODECOV_TOKEN"
echo "8. Paste the token value"
echo "9. Codecov uploads will work on next run"
echo ""
echo "✅ CI will pass regardless of Codecov upload status"
echo "📊 Coverage reports were still generated locally for inspection"
- name: Run VLLM tests (optional, manual trigger only)
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[vllm-tests]')
run: |
# Install VLLM test dependencies with Hydra
pip install testcontainers omegaconf hydra-core
# Run VLLM tests with Hydra configuration (single instance optimization)
python scripts/run_vllm_tests.py --no-hydra
continue-on-error: true # VLLM tests are allowed to fail in CI
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install linting tools
run: |
python -m pip install --upgrade pip
pip install ruff>=0.15.1
- name: Run linting (Ruff)
run: |
ruff --version
ruff check DeepResearch/ tests/ --extend-ignore=EXE001 --output-format=github
- name: Check formatting (Ruff)
run: |
ruff format --check DeepResearch/ tests/
types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Create venv and install deps
run: |
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -e .
pip install -e ".[dev]"
- name: Run ty type check
env:
VIRTUAL_ENV: .venv
run: |
uvx ty --version
uvx ty check