77 branches : [ main ]
88
99env :
10- PYTHON_VERSION : " 3.11 "
10+ PYTHON_VERSION : " 3.13 "
1111
1212jobs :
1313 code-quality :
@@ -18,12 +18,12 @@ jobs:
1818 - uses : actions/checkout@v4
1919
2020 - name : Set up Python
21- uses : actions/setup-python@v4
21+ uses : actions/setup-python@v5
2222 with :
2323 python-version : ${{ env.PYTHON_VERSION }}
2424
2525 - name : Cache pip dependencies
26- uses : actions/cache@v3
26+ uses : actions/cache@v4
2727 with :
2828 path : ~/.cache/pip
2929 key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
3333 - name : Install dependencies
3434 run : |
3535 python -m pip install --upgrade pip
36- pip install -r requirements.txt
37- pip install -r requirements-dev.txt
36+ pip install -e ".[dev]"
3837
3938 - name : Code formatting with Black
4039 run : black --check --line-length 120 app/ tests/
@@ -55,18 +54,18 @@ jobs:
5554
5655 strategy :
5756 matrix :
58- python-version : ["3.9 ", "3.10 ", "3.11 "]
57+ python-version : ["3.10 ", "3.11 ", "3.12", "3.13 "]
5958
6059 steps :
6160 - uses : actions/checkout@v4
6261
6362 - name : Set up Python ${{ matrix.python-version }}
64- uses : actions/setup-python@v4
63+ uses : actions/setup-python@v5
6564 with :
6665 python-version : ${{ matrix.python-version }}
6766
6867 - name : Cache pip dependencies
69- uses : actions/cache@v3
68+ uses : actions/cache@v4
7069 with :
7170 path : ~/.cache/pip
7271 key : ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements*.txt') }}
7675 - name : Install dependencies
7776 run : |
7877 python -m pip install --upgrade pip
79- pip install -r requirements.txt
80- pip install -r requirements-dev.txt
78+ pip install -e ".[dev]"
8179
8280 - name : Run unit tests
8381 env :
8785 pytest tests/ -v --cov=app --cov-report=xml --cov-report=html
8886
8987 - name : Upload coverage to Codecov
90- uses : codecov/codecov-action@v3
88+ uses : codecov/codecov-action@v4
9189 with :
9290 file : ./coverage.xml
9391 flags : unittests
@@ -102,12 +100,12 @@ jobs:
102100 - uses : actions/checkout@v4
103101
104102 - name : Set up Python
105- uses : actions/setup-python@v4
103+ uses : actions/setup-python@v5
106104 with :
107105 python-version : ${{ env.PYTHON_VERSION }}
108106
109107 - name : Cache pip dependencies
110- uses : actions/cache@v3
108+ uses : actions/cache@v4
111109 with :
112110 path : ~/Library/Caches/pip
113111 key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
@@ -117,12 +115,7 @@ jobs:
117115 - name : Install dependencies
118116 run : |
119117 python -m pip install --upgrade pip
120- pip install -r requirements.txt
121- pip install -r requirements-dev.txt
122-
123- - name : Install MLX (macOS only)
124- run : |
125- pip install mlx>=0.4.0 mlx-lm>=0.2.0
118+ pip install -e ".[dev,mlx]"
126119
127120 - name : Run tests with auto backend selection
128121 env :
@@ -143,7 +136,7 @@ jobs:
143136 BACKEND : torch
144137 LOG_LEVEL : DEBUG
145138 run : |
146- pytest tests/test_torch_backend .py -v
139+ pytest tests/test_backends .py::test_torch_backend -v
147140
148141 integration-tests :
149142 name : API Integration Tests
@@ -154,27 +147,27 @@ jobs:
154147 - uses : actions/checkout@v4
155148
156149 - name : Set up Python
157- uses : actions/setup-python@v4
150+ uses : actions/setup-python@v5
158151 with :
159152 python-version : ${{ env.PYTHON_VERSION }}
160153
161154 - name : Install dependencies
162155 run : |
163156 python -m pip install --upgrade pip
164- pip install -r requirements.txt
165- pip install -r requirements-dev.txt
157+ pip install -e ".[dev]"
166158
167159 - name : Run API integration tests
168160 env :
169161 BACKEND : torch
170162 run : |
171- pytest tests/test_api_integration .py -v
163+ pytest tests/test_integration .py -v
172164
173165 - name : Run performance benchmarks
174166 env :
175167 BACKEND : torch
168+ CI : true
176169 run : |
177- python -m app.utils.benchmark --quick
170+ timeout 120s python -m app.utils.benchmark --quick --ci || echo "Benchmark timed out or failed, continuing..."
178171
179172 security-scan :
180173 name : Security Scanning
@@ -195,7 +188,7 @@ jobs:
195188 safety check --json --output safety-report.json
196189
197190 - name : Upload security reports
198- uses : actions/upload-artifact@v3
191+ uses : actions/upload-artifact@v4
199192 if : always()
200193 with :
201194 name : security-reports
@@ -212,7 +205,7 @@ jobs:
212205 - uses : actions/checkout@v4
213206
214207 - name : Set up Python
215- uses : actions/setup-python@v4
208+ uses : actions/setup-python@v5
216209 with :
217210 python-version : ${{ env.PYTHON_VERSION }}
218211
@@ -222,17 +215,29 @@ jobs:
222215 pip install -r requirements.txt
223216
224217 # Test that the application can start
225- timeout 30s python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 &
226- sleep 10
227- curl -f http://localhost:8000/health/ || exit 1
218+ timeout 60s python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 &
219+ APP_PID=$!
220+ sleep 15
221+
222+ # Check if the health endpoint responds
223+ if curl -f --max-time 10 http://localhost:8000/health/ ; then
224+ echo "Health check passed"
225+ else
226+ echo "Health check failed"
227+ kill $APP_PID 2>/dev/null || true
228+ exit 1
229+ fi
230+
231+ # Clean up
232+ kill $APP_PID 2>/dev/null || true
228233
229234 - name : Build wheel
230235 run : |
231236 pip install build
232237 python -m build
233238
234239 - name : Upload build artifacts
235- uses : actions/upload-artifact@v3
240+ uses : actions/upload-artifact@v4
236241 with :
237242 name : dist
238243 path : dist/
0 commit comments