-
Notifications
You must be signed in to change notification settings - Fork 13
112 lines (105 loc) · 3.3 KB
/
Copy pathci.yml
File metadata and controls
112 lines (105 loc) · 3.3 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # hatch-vcs needs full history to derive version from tags
- uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: uv sync --extra server --extra ui --extra llm --extra openai --extra vertex --extra dev --extra estimation --extra quality-sync --extra kubernetes
- name: Ruff check
run: uv run ruff check src/ ui/ tests/
- name: Ruff format check
run: uv run ruff format --check src/ ui/ tests/
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- run: uv sync --extra server --extra ui --extra llm --extra openai --extra vertex --extra dev --extra estimation --extra quality-sync --extra kubernetes
- name: Mypy type check
run: uv run mypy src/ ui/ tests/
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --extra server --extra ui --extra llm --extra openai --extra vertex --extra dev --extra estimation --extra quality-sync --extra kubernetes
- name: Run unit tests
run: >
uv run pytest tests/ -v --tb=short
-m unit
--cov=src/planner
--cov-report=xml
--cov-report=term
- run: uv pip install "llm-optimizer @ git+https://github.com/bentoml/llm-optimizer.git"
- name: Run HuggingFace tests
continue-on-error: true
run: >
uv run pytest tests/ -v --tb=short
-m hf_network
--reruns 2
test-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Build wheel
run: uv build
- name: Install wheel in fresh venv
run: |
uv venv .venv-wheel
. .venv-wheel/bin/activate
uv pip install dist/*.whl
uv pip install pytest
- name: Run wheel E2E tests
run: |
. .venv-wheel/bin/activate
python -m pytest tests/wheel/ -v --tb=short
ci-status:
if: always()
needs: [lint, typecheck, test, test-wheel]
runs-on: ubuntu-latest
steps:
- name: Check CI status
run: |
if [[ "${{ needs.lint.result }}" != "success" ||
"${{ needs.typecheck.result }}" != "success" ||
"${{ needs.test.result }}" != "success" ||
"${{ needs.test-wheel.result }}" != "success" ]]; then
echo "CI failed"
exit 1
fi
echo "CI passed"