forked from waybarrios/vllm-mlx
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (131 loc) · 4.31 KB
/
ci.yml
File metadata and controls
152 lines (131 loc) · 4.31 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff black
- name: Run ruff
run: ruff check vllm_mlx/ tests/ --select E,F,W --ignore E402,E501,E731,F811,F841
- name: Run black
run: black --check vllm_mlx/ tests/
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy pydantic fastapi
- name: Run mypy
run: mypy vllm_mlx/ --ignore-missing-imports --no-error-summary
continue-on-error: true
test-matrix:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio pytest-cov pydantic fastapi jsonschema httpx psutil transformers requests
- name: Run unit tests (no MLX required)
run: |
pytest \
tests/test_mcp_security.py \
tests/test_structured_output.py \
tests/test_reasoning_parser.py \
tests/test_tool_parsers.py \
tests/test_streaming_json_encoder.py \
tests/test_native_tool_format.py \
tests/test_memory_cache.py \
tests/test_prefix_cache.py \
tests/test_mllm_cache.py \
tests/test_api_models.py \
tests/test_api_utils.py \
tests/test_request.py \
tests/test_anthropic_models.py \
tests/test_anthropic_adapter.py \
tests/test_harmony_parsers.py \
-v --tb=short \
-k "not Integration and not InjectJson and not TestMLXMultimodalLMCache" \
--cov=vllm_mlx \
--cov-report=term-missing \
--cov-report=xml
- name: Upload coverage
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
test-apple-silicon:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install project and dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[vision]"
pip install pytest pytest-asyncio
- name: Verify Apple Silicon
run: |
python -c "import platform; assert platform.machine() == 'arm64', 'Not ARM64'"
python -c "import mlx.core as mx; print(f'MLX OK: {mx.default_device()}')"
- name: Run MLX-dependent tests
run: |
pytest \
tests/test_platform.py \
tests/test_llm.py \
tests/test_mllm.py \
tests/test_server.py \
tests/test_paged_cache.py \
tests/test_mllm_continuous_batching.py \
tests/test_mllm_cache.py \
tests/test_optimizations.py \
tests/test_simple_engine.py \
tests/test_batching.py \
tests/test_continuous_batching.py \
-v --tb=short \
-m "not slow" \
-k "not Integration"
tests:
needs: [test-matrix, test-apple-silicon]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.test-matrix.result }}" != "success" ]; then
echo "Unit tests failed"
exit 1
fi
if [ "${{ needs.test-apple-silicon.result }}" != "success" ]; then
echo "Apple Silicon tests failed"
exit 1
fi