-
Notifications
You must be signed in to change notification settings - Fork 646
114 lines (111 loc) · 4.34 KB
/
run_tests.yml
File metadata and controls
114 lines (111 loc) · 4.34 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
name: _run-tests
on:
workflow_call:
inputs:
marker:
description: 'pytest -m expression (e.g., `not integration` or `integration`)'
required: true
type: string
pytest-params:
description: 'additional pytest params'
required: false
default: ""
type: string
notify-on-failure:
description: 'Post to Slack on test failure'
required: false
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# If set, uv will run without updating the uv.lock file. Equivalent to the `uv run --frozen`.
UV_FROZEN: "1"
jobs:
# Run linters in one step to reduce checkout & dependencies setup overhead
lint:
name: Lint (ruff + mypy + validate pyproject.toml)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install dependencies
uses: ./.github/actions/python-uv-setup
# Run ruff
- name: Run Ruff linter
run: uv run ruff check .
- name: Run Ruff formatter
run: uv run ruff format --check .
# Validate extras are defined in pyproject.toml
- name: Validate extra dependencies in "agents-core/pyproject.toml"
run: uv run dev.py validate-extras
# Run mypy
- name: Restore mypy cache
uses: actions/cache/restore@v5
with:
path: .mypy_cache
key: mypy-cache-${{ hashFiles('pyproject.toml') }}
- name: Run mypy for core
run: uv run dev.py mypy
- name: Run mypy for plugins
run: uv run dev.py mypy-plugins
- name: Save mypy cache
uses: actions/cache/save@v5
with:
path: .mypy_cache
key: mypy-cache-${{ hashFiles('pyproject.toml') }}
test:
name: Test "${{ inputs.marker }}"
runs-on: ubuntu-latest
env:
ASSEMBLYAI_API_KEY: ${{ secrets.ASSEMBLYAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CARTESIA_API_KEY: ${{ secrets.CARTESIA_API_KEY }}
DEEPGRAM_API_KEY: ${{ secrets.DEEPGRAM_API_KEY }}
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
FAL_KEY: ${{ secrets.FAL_KEY }}
FISH_API_KEY: ${{ secrets.FISH_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
STREAM_API_KEY: ${{ secrets.STREAM_API_KEY }}
STREAM_API_SECRET: ${{ secrets.STREAM_API_SECRET }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
TURBOPUFFER_API_KEY: ${{ secrets.TURBOPUFFER_API_KEY }}
AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }}
AWS_BEDROCK_API_KEY: ${{ secrets.AWS_BEDROCK_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
SARVAM_API_KEY: ${{ secrets.SARVAM_API_KEY }}
INWORLD_API_KEY: ${{ secrets.INWORLD_API_KEY }}
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Clean space as per https://github.com/actions/virtual-environments/issues/709
run: |
sudo rm -rf "/usr/share/dotnet" || true
sudo rm -rf "/usr/local/lib/android" || true
sudo rm -rf "/usr/local/share/boost" || true
sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libportaudio2
- name: Install dependencies
uses: ./.github/actions/python-uv-setup
- name: Run core tests
run: uv run pytest -m "${{ inputs.marker }}" tests/ ${{ inputs.pytest-params }}
- name: Run plugin tests
run: uv run pytest -m "${{ inputs.marker }}" plugins/*/tests/*.py ${{ inputs.pytest-params }}
- name: Notify Slack on failure
if: failure() && inputs.notify-on-failure
uses: ./.github/actions/notify-slack
with:
workflow-name: ${{ github.workflow }}
report-file: .report.json
summary: "${{ github.workflow }} failed"
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}