- Remove Codecov coverage upload causing rate limit errors - Remove pytest-cov dependency (not needed for CI) - Simplify test workflow to focus on functionality - All 37 tests still pass without coverage collection - Workflow now more reliable and faster 🔧 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
99 lines
2.7 KiB
YAML
99 lines
2.7 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Run unit tests
|
|
run: |
|
|
# Run all tests except live integration tests
|
|
# These tests use mocks and don't require API keys
|
|
python -m pytest tests/ --ignore=tests/test_live_integration.py -v
|
|
env:
|
|
# Ensure no API key is accidentally used in CI
|
|
GEMINI_API_KEY: ""
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install ruff black
|
|
|
|
- name: Run black formatter check
|
|
run: black --check .
|
|
|
|
- name: Run ruff linter
|
|
run: ruff check .
|
|
|
|
live-tests:
|
|
runs-on: ubuntu-latest
|
|
# Only run live tests on main branch pushes (requires manual API key setup)
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Check API key availability
|
|
id: check-key
|
|
run: |
|
|
if [ -z "${{ secrets.GEMINI_API_KEY }}" ]; then
|
|
echo "api_key_available=false" >> $GITHUB_OUTPUT
|
|
echo "⚠️ GEMINI_API_KEY secret not configured - skipping live tests"
|
|
else
|
|
echo "api_key_available=true" >> $GITHUB_OUTPUT
|
|
echo "✅ GEMINI_API_KEY found - running live tests"
|
|
fi
|
|
|
|
- name: Run live integration tests
|
|
if: steps.check-key.outputs.api_key_available == 'true'
|
|
run: |
|
|
# Run live tests that make actual API calls
|
|
python tests/test_live_integration.py
|
|
env:
|
|
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
|
|
|
- name: Skip live tests
|
|
if: steps.check-key.outputs.api_key_available == 'false'
|
|
run: |
|
|
echo "🔒 Live integration tests skipped (no API key configured)"
|
|
echo "To enable live tests, add GEMINI_API_KEY as a repository secret" |