---
name: Run unit tests on PR creation
run-name: ${{github.actor}} is running ${{github.workflow}}
on: [push]

jobs:
  run-unit-tests:
    runs-on: [default]
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.13'

      - name: Install dependencies
        run: |
          pip install --upgrade pip setuptools
          pip install -r requirements.txt

      - name: Execute Pytest unit tests
        env:
          OPENAI_BASE_URL: "YOUR URL"
          OPENAI_API_KEY: "dummy-api-key-for-testing"
        run: |
          pip install pytest-cov
          pytest --doctest-modules --junitxml=junit/test-results.xml \
            --cov=com --cov-report=xml --cov-report=html