forked from agno-agi/agno
-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (174 loc) · 5.21 KB
/
Copy pathtest.yml
File metadata and controls
193 lines (174 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Validation
on:
push:
branches:
- "main"
- "v2.6.0"
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- "main"
- "v2.6.0"
- "feat/v2.7" # Sub-PRs into the release branch get the same gate
- "feat/v3.0" # Sub-PRs into the 3.0 line get the same gate
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
style-check-agno:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
defaults:
run:
working-directory: libs/agno
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
# Install the workspace agnoctl alongside agno so a just-bumped,
# not-yet-published agnoctl version cannot break the resolve.
python -m pip install -e ../agnoctl -e .[dev]
- name: Ruff check
run: |
ruff check .
- name: Mypy
run: |
mypy . --config-file pyproject.toml
style-check-agnoctl:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
defaults:
run:
working-directory: libs/agnoctl
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -e .[dev]
- name: Ruff check
run: |
ruff check .
- name: Mypy
run: |
mypy . --config-file pyproject.toml
- name: Run agnoctl tests
run: |
python -m pytest ./tests
style-check-cookbook:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
defaults:
run:
working-directory: cookbook
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -e ../libs/agnoctl -e "../libs/agno/"[dev]
- name: Ruff check
run: |
ruff check .
# - name: Mypy
# run: |
# mypy .
style-check-agno-infra:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
defaults:
run:
working-directory: libs/agno_infra
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install -e .[dev]
- name: Ruff check
run: |
ruff check .
- name: Mypy
run: |
mypy . --config-file pyproject.toml
tests:
runs-on: ubuntu-latest
# Skip push events if there's an open PR from the same branch
if: github.event_name != 'push' || !github.event.pull_request
strategy:
matrix:
group: [1, 2, 3, 4, 5]
fail-fast: true
name: tests (${{ matrix.group }}/5)
# The catalog's Postgres suites live under tests/unit and skip themselves
# without a server, so the adapter production actually runs had no gate at
# all: only the SQLite half of every owner-scope and liveness guard was
# ever executed. Same image, port and credentials the conftest targets.
services:
postgres:
image: agnohq/pgvector:18
env:
POSTGRES_DB: ai
POSTGRES_USER: ai
POSTGRES_PASSWORD: ai
ports:
- "5532:5432"
options: >-
--health-cmd "pg_isready -U ai -d ai"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Set up uv with cache
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: "libs/agno/pyproject.toml"
- name: Run test setup
working-directory: .
run: |
set -e
./scripts/test_setup.sh
- name: Run tests (group ${{ matrix.group }}/5)
working-directory: .
env:
AGNO_TELEMETRY: false
run: |
source .venv/bin/activate
# psycopg, so the catalog's Postgres suites resolve their driver and
# run against the service above instead of importorskip-ing away.
uv pip install pytest-split "psycopg[binary]" --quiet
python -m pytest --splits 5 --group ${{ matrix.group }} ./libs/agno/tests/unit --ignore=libs/agno/tests/unit/models/litellm --ignore=libs/agno/tests/unit/tools/test_crawl4ai.py --ignore=libs/agno/tests/unit/tools/test_scrapegraph.py