-
Notifications
You must be signed in to change notification settings - Fork 18
50 lines (50 loc) · 1.43 KB
/
run_coverage.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
name: Run Coverage
on: [pull_request]
jobs:
test:
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install poetry
run: |
pip install poetry
- name: Start Database
run: |
cd api/local
docker compose up --wait
cd ../..
- name: Start Server
run: |
cd api
poetry install --no-root
poetry run uvicorn src.main:app &
sleep 5
cd ..
env:
DATABASE_TYPE: postgres
CONNECTION_URI: postgresql+psycopg://testuser:testpwd@localhost:5432/honcho
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Run Tests
run: |
cd sdk
poetry install
poetry run coverage run -m pytest
poetry run coverage report --format=markdown > coverage.md
echo -e "\n---\n# Docstring Coverage\n\`\`\`" >> coverage.md
poetry run interrogate -v honcho >> coverage.md
echo -e "\`\`\`" >> coverage.md
cd ..
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: sdk/coverage.md
- name: Stop Server
run: |
kill $(jobs -p) || true