-
Notifications
You must be signed in to change notification settings - Fork 100
70 lines (68 loc) · 2.21 KB
/
test.yml
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
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
- run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- run: poetry install --all-extras
- run: poetry run ruff check --output-format=github .
- run: poetry run ruff format --check .
- run: poetry run mypy .
- run: poetry 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: poetry run pytest -vv tests/ -m 'anthropic'
- if: inputs.litellm_anthropic
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: poetry 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: poetry run pytest -vv tests/ -m 'litellm_openai'
- if: inputs.mistral
env:
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: poetry 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: poetry run pytest -vv tests/ -m 'openai'