Skip to content
Open
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
77 changes: 50 additions & 27 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Tox pytest all python versions
name: Tox + Poetry CI (All Python Versions)

on:
push:
branches: [ main ]
paths:
- gpt_engineer/**
- tests/**
- pyproject.toml
- poetry.lock
pull_request:
branches: [ main ]

Expand All @@ -16,34 +18,55 @@ concurrency:
jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version == '3.12' && '3.12.3' || matrix.python-version }} # Using 3.12.3 to resolve Pydantic ForwardRef issue
cache: 'pip' # Note that pip is for the tox level. Poetry is still used for installing the specific environments (tox.ini)

- name: Check Python Version
run: python --version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==4.15.0 poetry

- name: Run tox
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: tox

# Temporarily disabling codecov until we resolve codecov rate limiting issue
# - name: Report coverage
# run: |
# bash <(curl -s https://codecov.io/bash)
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Verify Python version
run: python --version

- name: Install Poetry & Tox
run: |
python -m pip install --upgrade pip
pip install poetry tox==4.15.0

- name: Configure Poetry & Install dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true

# Try install; regenerate lock file if outdated
poetry install --no-interaction --no-root || (
echo "poetry.lock is outdated — regenerating..." &&
poetry lock --no-update &&
poetry install --no-interaction --no-root
)

- name: Run tests with Poetry (pytest)
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
poetry run pytest -q --maxfail=1 --disable-warnings -v

- name: Run tests via Tox (multi-environment)
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
tox -vv

# Optional: Enable later when Codecov is stable
# - name: Upload coverage
# uses: codecov/codecov-action@v5
# with:
# fail_ci_if_error: false
Loading