forked from guidance-ai/guidance
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.68 KB
/
ci_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
# CI Tests
# These should only be run on main, because they access secrets
name: CI Tests
on:
workflow_dispatch:
push:
branches: [main]
schedule:
# * is a special character in YAML so we quote this string
# Run at 1030 UTC every day
- cron: '30 10 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .[test]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
env:
# Indicate that secrets should be available
EXPECT_SECRETS: 1
# Configure endpoints
AZUREAI_CHAT_ENDPOINT: ${{ secrets.AZUREAI_CHAT_ENDPOINT }}
AZUREAI_CHAT_KEY: ${{ secrets.AZUREAI_CHAT_KEY }}
AZUREAI_CHAT_MODEL: ${{ secrets.AZUREAI_CHAT_MODEL }}
AZUREAI_COMPLETION_ENDPOINT: ${{ secrets.AZUREAI_COMPLETION_ENDPOINT }}
AZUREAI_COMPLETION_KEY: ${{ secrets.AZUREAI_COMPLETION_KEY }}
AZUREAI_COMPLETION_MODEL: ${{ secrets.AZUREAI_COMPLETION_MODEL }}
run: |
pytest --cov=guidance --cov-report=xml --cov-report=term-missing ./tests/models/test_azureai_openai.py
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}