generated from streamlit/chatbot-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 987 Bytes
/
unit-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
name: Python Tests
on:
push:
branches: [ main, jeromehardaway/update-code-clean ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10.15'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
- name: Create temporary secrets.toml
# This creates a temporary secrets.toml file using the OPENAI_API_KEY from GitHub Secrets
run: |
mkdir -p ~/.streamlit
echo -e "[openai]\nOPENAI_API_KEY = \"${{ secrets.OPENAI_API_KEY }}\"" > ~/.streamlit/secrets.toml
- name: Run tests with coverage report
env:
TESTING: "true"
run: |
pytest --cov --cov-report=term-missing