Initial benchmarks

This commit is contained in:
Vik Paruchuri
2025-10-20 15:11:12 -04:00
parent 313f9c71b8
commit 98989faae4
16 changed files with 860 additions and 76 deletions

28
.github/workflows/integration.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Marker Plus CI tests
on: [push]
jobs:
tests:
runs-on: t4_gpu
steps:
- uses: actions/checkout@v3
- name: Install apt requirements
run: |
sudo apt-get update
sudo apt-get install -y libpango-1.0-0 libharfbuzz0b libpangoft2-1.0-0 libgdk-pixbuf2.0-0 libcairo2 libffi-dev shared-mime-info
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install python dependencies
run: |
uv sync --group dev
- name: Run tests
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
PYTHONPATH: .
run: |
uv run pytest tests/integration

43
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Python package
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Extract and verify version
id: version
run: |
# Get the tag name (e.g., v1.2.3)
TAG_VERSION="${GITHUB_REF#refs/tags/}"
echo "Tag version: $TAG_VERSION"
# Extract version from pyproject.toml (e.g., 1.2.3)
PYPROJECT_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "pyproject.toml version: $PYPROJECT_VERSION"
# Compare versions (tag should be v{pyproject_version})
if [ "$TAG_VERSION" != "v$PYPROJECT_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match pyproject.toml version (v$PYPROJECT_VERSION)"
exit 1
fi
echo "Version verification passed!"
echo "version=$TAG_VERSION" >> $GITHUB_OUTPUT
- name: Build package
run: |
uv build
- name: Publish package
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
uv publish --token "$PYPI_TOKEN"