Skip to content
Merged
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
36 changes: 29 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,32 @@ name: CI

on:
push:
branches: ["main"]
branches: ["main", "release/**"]
pull_request:
branches: ["main"]
branches: ["main", "release/**"]

jobs:
# `scripts/check` (ruff, pyright, check-sdist, uv lock) runs once on a fixed
# interpreter. pyright must see `pydantic-ai-slim` to resolve the bridge's
# `pydantic_ai` imports, and that extra is marker-gated to Python 3.10+, so
# this job pins 3.12 — running it across the test matrix would fail on 3.9.
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
enable-cache: true

- name: Install dependencies
run: uv sync --frozen --extra pydantic-ai

- name: Run linters
run: scripts/check

test:
runs-on: ubuntu-latest
strategy:
Expand All @@ -21,19 +42,20 @@ jobs:
python-version: ${{ matrix.python-version }}
enable-cache: true

# `[pydantic-ai]` is the optional extra that pulls `pydantic-ai-slim` for
# the `fasta2a.pydantic_ai` bridge tests. Marker-gated to Python 3.10+, so
# on 3.9 it resolves to nothing and the bridge tests skip themselves via
# `pytest.importorskip('pydantic_ai')` in `tests/test_pydantic_ai.py`.
- name: Install dependencies
run: uv sync --frozen

- name: Run linters
run: scripts/check
run: uv sync --frozen --extra pydantic-ai

- name: Run tests
run: scripts/test

# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check:
if: always()
needs: [test]
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ pydantic-ai = ["pydantic-ai-slim>=1.92; python_version >= '3.10'"]

[dependency-groups]
dev = [
"anyio",
"asgi-lifespan",
"coverage",
"dirty-equals",
"httpx",
"inline-snapshot",
"pytest",
Expand Down
Binary file added tests/assets/kiwi.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading