Skip to content

Example Tests

Example Tests #856

Workflow file for this run

name: Example Tests
on:
# Run a cron job every 12 hours
schedule:
- cron: '0 */12 * * *'
workflow_call:
inputs:
working-directory:
required: true
type: string
api_key:
required: false
type: string
base_url:
required: false
type: string
author:
required: false
type: string
commit_message:
required: false
type: string
dont_notify:
required: false
type: boolean
workflow_dispatch:
inputs:
working-directory:
required: true
type: string
api_key:
required: false
type: string
base_url:
required: false
type: string
author:
required: false
type: string
commit_message:
required: false
type: string
dont_notify:
required: false
type: boolean
jobs:
run-tests:
name: Run Example Tests
defaults:
run:
working-directory: ${{ inputs.working-directory }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
package:
[
autogen,
camel,
claude,
crew_ai,
griptape,
julep,
langchain,
llamaindex,
lyzr,
openai,
langgraph,
phidata,
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run Tests
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
HELICONE_API_KEY: ${{secrets.HELICONE_API_KEY}}
JULEP_API_KEY: ${{secrets.JULEP_API_KEY}}
JULEP_API_URL: ${{secrets.JULEP_API_URL}}
PDL_API_KEY: ${{secrets.PDL_API_KEY}}
COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_PROD }}
COMPOSIO_BASE_URL: ${{ inputs.base_url || secrets.COMPOSIO_BASE_URL || 'https://backend.composio.dev/api' }}
# TODO(@kaavee): Add Anthropic API key
run: |
python -m pip install uv
python -m uv pip install --upgrade pip pytest
python -m uv pip install plugins/${{ matrix.package }}
python -m uv pip install '.[all]'
python -m uv pip install 'numpy<2' python-dotenv
python -m uv pip install unstructured
COMPOSIO_BASE_URL=${{ env.COMPOSIO_BASE_URL }} COMPOSIO_API_KEY=${{ env.COMPOSIO_API_KEY }} COMPOSIO_LOGGING_LEVEL='debug' CI=false PLUGIN_TO_TEST=${{ matrix.package }} python -m uv run pytest -vv tests/test_example.py
COMPOSIO_BASE_URL=${{ env.COMPOSIO_BASE_URL }} COMPOSIO_API_KEY=${{ env.COMPOSIO_API_KEY }} COMPOSIO_LOGGING_LEVEL='debug' CI=false PLUGIN_TO_TEST=${{ matrix.package }} python -m uv run pytest -vv tests/test_load_tools.py
- name: Slack Notification on Failure
if: ${{ failure() && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, 'release') && !contains(github.event.head_commit.message, 'Release') && !inputs.dont_notify }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_TECH_WEBHOOK }}
SLACK_TITLE: "Example Tests Failed"
SLACK_MSG_AUTHOR: ${{ inputs.author || github.actor }}
SLACK_MESSAGE: "<@viraj> <@tushar> ${{ inputs.commit_message || github.event.head_commit.message }}"
SLACK_LINK_NAMES: "true"
SLACK_COLOR: "failure"
SLACK_USERNAME: "GitHub Actions Bot"
SLACK_ICON_EMOJI: ":x:"
SLACK_FOOTER: "Failed Example Tests | GitHub Actions"