mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
130 lines
3 KiB
YAML
130 lines
3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Cache pip packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-${{ matrix.python-version }}-
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -e ".[dev]"
|
|
|
|
- name: Run linting
|
|
if: matrix.python-version == '3.12'
|
|
run: |
|
|
ruff check .
|
|
ruff format --check .
|
|
|
|
- name: Run type checking
|
|
if: matrix.python-version == '3.12'
|
|
run: |
|
|
mypy headroom --ignore-missing-imports
|
|
|
|
- name: Run tests
|
|
run: |
|
|
pytest -v --tb=short
|
|
|
|
- name: Run tests with coverage
|
|
if: matrix.python-version == '3.11'
|
|
run: |
|
|
pytest --cov=headroom --cov-report=xml --cov-report=term-missing
|
|
|
|
- name: Upload coverage to Codecov
|
|
if: matrix.python-version == '3.11'
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
file: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
|
|
test-extras:
|
|
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 with relevance extras
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -e ".[dev,relevance]"
|
|
|
|
- name: Run relevance tests
|
|
run: |
|
|
pytest tests/test_relevance.py -v
|
|
|
|
test-agno:
|
|
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 with agno extras
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -e ".[dev,agno]"
|
|
|
|
- name: Run agno tests
|
|
run: |
|
|
pytest tests/test_integrations/agno/ -v
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Install build tools
|
|
run: |
|
|
python -m pip install --upgrade pip build twine
|
|
|
|
- name: Build package
|
|
run: |
|
|
python -m build
|
|
|
|
- name: Check package
|
|
run: |
|
|
twine check dist/*
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dist
|
|
path: dist/
|