Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached dependencies
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction

- name: Run tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
poetry run pytest

- name: Run linting
run: |
poetry run ruff check .

- name: Run type checking
run: |
poetry run mypy src
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,29 @@ poetry run mypy src/
poetry run ruff check . && poetry run ruff format --check . && poetry run mypy src/ && poetry run pytest
```

## Continuous Integration

This project uses GitHub Actions for CI/CD. The workflow runs on Python 3.8, 3.9, 3.10, and 3.11.

### CI Configuration

The CI workflow includes:
- Dependency installation with Poetry
- Running tests with pytest
- Code linting with ruff
- Type checking with mypy

### OpenAI API Key for CI

The CI workflow requires access to the OpenAI API key to run integration tests. The API key should be configured as a GitHub repository secret:

1. Go to your repository settings
2. Navigate to "Secrets and variables" → "Actions"
3. Add a new repository secret named `OPENAI_API_KEY`
4. Set the value to your OpenAI API key

The tests are designed to gracefully skip OpenAI integration tests if the API key is not available, so the CI will still pass without the secret, but some tests will be skipped.

## LLM Usage

This package provides a factory pattern for creating and using different LLM providers.
Expand Down
190 changes: 189 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading