Files
agent-framework/.github/workflows/python-unit-tests.yml
T
Eduard van Valkenburg 7cc29fe192 Python: package setup with logger (#125)
* package setup with logger

* set config once

* add unit test workflow

* updated naming of workflows

* add mypy check

* renamed job

* smaller name

* ignore certain files for ruff

* remove assignment

* fix ruff config

* removed pyright from pre-commit

* fixed logging test

* fix mypy setup

* mypy fix

* mypy

* mypy
2025-07-02 15:17:28 +00:00

51 lines
1.4 KiB
YAML

name: Python - Unit Tests
on:
pull_request:
branches: ["main", "feature*"]
paths:
- "python/**"
env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
jobs:
python-unit-tests:
name: Python Unit Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
UV_PYTHON: ${{ matrix.python-version }}
permissions:
contents: write
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.x"
enable-cache: true
cache-suffix: ${{ runner.os }}-${{ matrix.python-version }}
cache-dependency-glob: "**/uv.lock"
- name: Install the project
run: uv sync --all-extras --dev -U --prerelease=if-necessary-or-explicit
- name: Test with pytest
env:
PYTHON_GIL: ${{ matrix.gil }}
run: uv run --frozen pytest --junitxml=pytest.xml ./tests/unit
- name: Surface failing tests
uses: pmeier/pytest-results-action@v0.7.2
with:
path: python/pytest.xml
summary: true
display-options: fEX
fail-on-empty: true
title: Test results