-
Notifications
You must be signed in to change notification settings - Fork 2
210 lines (179 loc) · 6.03 KB
/
ci.yml
File metadata and controls
210 lines (179 loc) · 6.03 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
name: CI
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
permissions:
contents: read
jobs:
hook-integrity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate pre-commit hook references
run: python dev/scripts/validate_pre_commit_hooks.py
routing-unification-compliance:
needs: hook-integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run routing unification compliance gate
run: |
python dev/scripts/check_routing_unification_compliance.py
test-core:
needs: hook-integrity
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check boundary types
run: |
python dev/scripts/check_boundary_types.py
- name: Run unit tests with coverage
env:
OPENAI_API_KEY: dummy_key
GEMINI_API_KEY: dummy_key
ANTHROPIC_API_KEY: dummy_key
OPENROUTER_API_KEY: dummy_key
run: |
python -m pytest -v \
tests/unit/core/app \
tests/unit/core/cli_support \
tests/unit/core/common \
tests/unit/core/di \
tests/unit/connectors/gemini_base \
tests/unit/connectors/openai_codex \
tests/unit/chat_completions_tests/test_gemini_api_compatibility_di.py \
tests/unit/test_app_startup.py \
--ignore=tests/unit/connectors/gemini_base/test_credential_coordinator.py \
--cov=src --cov-branch --cov-report=xml
- name: Run integration tests with coverage append
env:
OPENAI_API_KEY: dummy_key
GEMINI_API_KEY: dummy_key
ANTHROPIC_API_KEY: dummy_key
OPENROUTER_API_KEY: dummy_key
run: |
if python - <<'PY'
from importlib.metadata import entry_points
oauth_entry_points = [
ep for ep in entry_points(group="llm_proxy.backends")
if "oauth" in ep.name.lower()
]
raise SystemExit(0 if oauth_entry_points else 1)
PY
then
python -m pytest -v tests/integration/test_oauth_connector_filtering.py --cov=src --cov-branch --cov-append --cov-report=xml
else
echo "No OAuth plugin entry points detected; skipping OAuth-only integration tests."
fi
- name: Upload combined coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: matdev83/llm-interactive-proxy
files: ./coverage.xml
fail_ci_if_error: false
plugin-boundary:
needs: hook-integrity
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
env:
OAUTH_PLUGIN_INSTALL_TARGET: llm-interactive-proxy-oauth-connectors
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install core dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install OAuth plugin package
run: |
pip install "${OAUTH_PLUGIN_INSTALL_TARGET}" || \
echo "OAuth plugin package unavailable on index; continuing with fail-open boundary checks."
- name: Run plugin-boundary verification tests
run: |
python -m pytest -v \
tests/unit/core/common/test_oauth_packaging_contract.py \
tests/unit/core/common/test_backend_discovery_state.py \
tests/unit/core/services/test_backend_plugin_discovery.py \
tests/unit/core/services/test_backend_registry_oauth_errors.py
if python - <<'PY'
from importlib.metadata import entry_points
oauth_entry_points = [
ep for ep in entry_points(group="llm_proxy.backends")
if "oauth" in ep.name.lower()
]
raise SystemExit(0 if oauth_entry_points else 1)
PY
then
echo "OAuth plugin entry points detected; running integration boundary checks."
python -m pytest -v tests/integration/test_oauth_connector_filtering.py
else
echo "No OAuth plugin entry points detected; skipping OAuth-only integration boundary checks."
fi
test-extended-nonblocking:
needs: hook-integrity
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run extended unit suite (non-blocking)
env:
OPENAI_API_KEY: dummy_key
GEMINI_API_KEY: dummy_key
ANTHROPIC_API_KEY: dummy_key
OPENROUTER_API_KEY: dummy_key
run: |
python -m pytest -v tests/unit