-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.68 KB
/
python-tests.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
name: Python Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
pip install aiofiles pytest pytest-asyncio
- name: Setup test environment
run: |
# Create config directory if it doesn't exist
mkdir -p config
# Create basic config.yaml in config directory
echo "models:
default:
provider: openai
model: gpt-4o-mini
api_key: sk-test
gpt-4:
provider: openai
model: gpt-4
api_key: sk-test
" > config/config.yaml
# Create basic .env file in config directory
echo "DEFAULT_API_KEY=dummy-key
DEFAULT_BASE_URL=https://api.openai.com/v1
DEFAULT_MODEL=gpt-3.5-turbo" > config/.env
- name: Run tests without LLM integration
run: |
PYTHONPATH=$PYTHONPATH:$(pwd) pytest -v -m "not llm_integration"
# - name: Run all tests including LLM integration
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# env:
# DEFAULT_API_KEY: ${{ secrets.DEFAULT_API_KEY }}
# DEFAULT_BASE_URL: ${{ secrets.DEFAULT_BASE_URL }}
# DEFAULT_MODEL: ${{ secrets.DEFAULT_MODEL }}
# run: pytest -v