llama-stack-mirror/.github/workflows/unit-tests.yml
Ihar Hrachyshka 4c6a339de9 chore: Add ./scripts/unit-tests.sh
Useful for local development. Now you can just trigger the script and
not care about specific arguments to pass to run unit tests.

You can also pass PYTHON_VERSION= through envvar to change the default
python version used (default: 3.10).

Co-authored-by: Nathan Weinberg <31703736+nathan-weinberg@users.noreply.github.com>
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-03-13 10:40:19 -04:00

47 lines
1.2 KiB
YAML

name: Unit Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python }}
enable-cache: false
- name: Run unit tests
run: |
PYTHON_VERSION=${{ matrix.python }} ./scripts/unit-tests.sh --cov=llama_stack --junitxml=pytest-report-${{ matrix.python }}.xml --cov-report=html:htmlcov-${{ matrix.python }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.python }}
path: |
.pytest_cache/
pytest-report-${{ matrix.python }}.xml
htmlcov-${{ matrix.python }}/
retention-days: 7