Skip to content

feat: add PyPI publishing via trusted publisher and dynamic versioning #608

feat: add PyPI publishing via trusted publisher and dynamic versioning

feat: add PyPI publishing via trusted publisher and dynamic versioning #608

Workflow file for this run

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"