Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add actions again? #29

Merged
merged 6 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/run_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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: Syncify Client
hyusap marked this conversation as resolved.
Show resolved Hide resolved
run: |
python scripts/syncronizer.py
- 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://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 xml -o coverage.xml
hyusap marked this conversation as resolved.
Show resolved Hide resolved
cd ..
- name: Code Coverage
uses: irongut/[email protected]
with:
filename: sdk/coverage.xml
badge: true
output: file
format: markdown
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: code-coverage-results.md
- name: Stop Server
run: |
kill $(jobs -p) || true
49 changes: 49 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Run Tests
on: [push, 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: Syncify Client
run: |
python scripts/syncronizer.py
- 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://testuser:testpwd@localhost:5432/honcho
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Run Tests
run: |
cd sdk
poetry install
poetry run pytest
cd ..
- name: Stop Database
run: |
cd api/local
docker compose down
cd ../..
- name: Stop Server
run: |
kill $(jobs -p) || true
92 changes: 70 additions & 22 deletions sdk/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ httpx = "^0.26.0"
[tool.poetry.group.test.dependencies]
pytest = "^7.4.4"
pytest-asyncio = "^0.23.4"
coverage = "^7.4.3"

[build-system]
requires = ["poetry-core"]
Expand Down
Loading