Example Tests #676
This file contains 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: Example Tests | |
on: | |
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}} | |
JULEP_API_KEY: ${{secrets.JULEP_API_KEY}} | |
JULEP_API_URL: ${{secrets.JULEP_API_URL}} | |
LISTENNOTES_API_KEY: ${{secrets.LISTENNOTES_API_KEY}} | |
COMPOSIO_API_KEY: ${{ inputs.api_key || secrets.COMPOSIO_API_KEY_RELEASE }} | |
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 --upgrade pip pipenv pytest | |
python -m pip install plugins/${{matrix.package}} | |
python -m pip install '.[all]' | |
python -m pip install 'numpy<2' python-dotenv | |
python -m pip install unstructured | |
COMPOSIO_BASE_URL=${{ env.COMPOSIO_BASE_URL }} COMPOSIO_API_KEY=${{ env.COMPOSIO_API_KEY }} COMPOSIO_LOGGING_LEVEL='debug' PLUGIN_TO_TEST=${{matrix.package}} CI=false pytest -vv tests/test_example.py | |
COMPOSIO_BASE_URL=${{ env.COMPOSIO_BASE_URL }} COMPOSIO_API_KEY=${{ env.COMPOSIO_API_KEY }} COMPOSIO_LOGGING_LEVEL='debug' PLUGIN_TO_TEST=${{matrix.package}} CI=false 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> <@kaavee> ${{ 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" |