Test #719
Workflow file for this run
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: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
anthropic: | |
description: "Test using Anthropic API" | |
type: boolean | |
default: false | |
litellm_anthropic: | |
description: "Test using Anthropic API via LiteLLM" | |
type: boolean | |
default: false | |
litellm_openai: | |
description: "Test using OpenAI API via LiteLLM" | |
type: boolean | |
default: false | |
mistral: | |
description: "Test using Mistral API" | |
type: boolean | |
default: false | |
openai: | |
description: "Test using OpenAI API" | |
type: boolean | |
default: false | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
- name: Set up uv | |
uses: astral-sh/setup-uv@v2 | |
- name: Install dependencies | |
run: uv sync | |
- run: uv run ruff check --output-format=github . | |
- run: uv run ruff format --check . | |
- run: uv run mypy . | |
- run: uv run pytest -vv tests/ | |
# Do not use `github.event.inputs` because it converts booleans to strings | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs | |
- if: inputs.anthropic | |
env: | |
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
run: uv run pytest -vv tests/ -m 'anthropic' | |
- if: inputs.litellm_anthropic | |
env: | |
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
run: uv run pytest -vv tests/ -m 'litellm_anthropic' | |
- if: inputs.litellm_openai | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
OPENAI_ORG_ID: ${{ secrets.OPENAI_ORG_ID }} | |
run: uv run pytest -vv tests/ -m 'litellm_openai' | |
- if: inputs.mistral | |
env: | |
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | |
run: uv run pytest -vv tests/ -m 'mistral' | |
- if: inputs.openai | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
OPENAI_ORG_ID: ${{ secrets.OPENAI_ORG_ID }} | |
run: uv run pytest -vv tests/ -m 'openai' |