-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (34 loc) · 1010 Bytes
/
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
name: tests
on: [pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
# Checkout the repository
- uses: actions/checkout@v3
# Set up Python
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Set up pip cache
- name: Set up pip cache
if: runner.os == 'Linux'
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: ${{ runner.os }}-pip-
# Install Hatch
- name: Install Hatch
run: pipx install hatch
# Install pytest-asyncio for async test support
- name: Install pytest-asyncio
run: pip install pytest-asyncio
# Run tests with OpenAI API key
- name: Run tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: hatch test