Ready for V1 #207
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # The package advertises Python >= 3.12, but CI only ever ran 3.13, so | |
| # 3.12 was supported on paper and never verified. Test both. | |
| python-version: ["3.12", "3.13"] | |
| # Real services. The durable-storage tests (checkpointer transactions, | |
| # optimistic concurrency, Redis/Postgres consistency) cannot prove anything | |
| # against mocks -- they need a real database to run against. | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: test_agentflow | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U test" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| POSTGRES_DSN: postgresql://test:test@localhost:5432/test_agentflow | |
| REDIS_URL: redis://localhost:6379/1 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache Python deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/pip | |
| .venv | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-py${{ matrix.python-version }}-pip- | |
| - name: Cache uv | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.local/share/uv | |
| ~/.cache/uv | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-uv-${{ hashFiles('.uv/config.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-py${{ matrix.python-version }}-uv- | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| # create venv in repo so it can be cached | |
| python -m venv --clear .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| uv sync --dev | |
| - name: Run pre-commit | |
| if: matrix.python-version == '3.13' | |
| run: uv run pre-commit run --all-files | |
| - name: Run unit tests with coverage (line + branch gated) | |
| run: | | |
| source .venv/bin/activate | |
| uv run pytest --cov --cov-branch --cov-report=xml | |
| - name: Run integration tests against real Postgres + Redis | |
| run: | | |
| source .venv/bin/activate | |
| # These exercise the durable paths (SQL, transactions, optimistic | |
| # concurrency, tool ledger, cross-user isolation). They are gated behind | |
| # --integration so they never run without the services above. | |
| uv run pytest tests/integration --integration --no-cov | |
| - name: Upload coverage reports to Codecov | |
| if: matrix.python-version == '3.13' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |