Skip to content

Drop support for py38 & uv chore upgrade #3

Drop support for py38 & uv chore upgrade

Drop support for py38 & uv chore upgrade #3

Workflow file for this run

# :: Use nektos/act to run this locally
# :: Example:
# :: `act push -j python-tests --matrix python-version:3.10 --container-architecture linux/amd64`
name: Python Tests
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'agentops/**/*.py'
- 'agentops/**/*.ipynb'
- 'tests/**/*.py'
- 'tests/**/*.ipynb'
pull_request:
branches:
- main
paths:
- 'agentops/**/*.py'
- 'agentops/**/*.ipynb'
- 'tests/**/*.py'
- 'tests/**/*.ipynb'
jobs:
python-tests:
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AGENTOPS_API_KEY: ${{ secrets.AGENTOPS_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup UV
uses: astral-sh/setup-uv@v5
continue-on-error: true
with:
python-version: ${{ matrix.python-version }}
cache-prefix: uv-${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install dependencies
run: |
uv sync --dev --group test
- name: Install coverage tools
run: |
uv tool install coverage
- name: Run tests with coverage
run: |
uvx coverage run --source . -m pytest
uvx coverage report -m
uvx coverage xml
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AGENTOPS_API_KEY: ${{ secrets.AGENTOPS_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
AI21_API_KEY: ${{ secrets.AI21_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
FIREWORKS_API_KEY: ${{ secrets.FIREWORKS_API_KEY }}
# Only upload coverage report for python3.11
- name: Upload coverage to Codecov
if: ${{matrix.python-version == '3.11'}}
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true