Skip to content

Commit

Permalink
ci: fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiruha01 committed Jul 15, 2024
1 parent bcb5dea commit bc14c5f
Show file tree
Hide file tree
Showing 5 changed files with 2,251 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/test_image
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex

PROJECT_NAME=smartapp-template

python -m copier --defaults . smartapp-template
python -m copier copy --defaults --trust . smartapp-template
docker build -t $PROJECT_NAME $PROJECT_NAME

# there should be added `--fail` option to curl command when healthcheck endpoint is added
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ jobs:

- name: Install copier
run: |
pip install copier==7.1.0
pip install copier==9.3.1
pip install copier-templates-extensions
pip install pyyaml-include==1.4.1
# hardcode pydantic version to avoid dependency conflict with copier
pip install pydantic==1.10.2
# pip install pydantic==1.10.2
- name: Test image
env:
Expand All @@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10" ]
python-version: [ "3.9", "3.10", "3.11" ]

services:
postgres:
Expand Down Expand Up @@ -93,12 +93,12 @@ jobs:

- name: Install copier
run: |
pip install copier==7.1.0
pip install copier==9.3.1
pip install copier-templates-extensions
pip install pyyaml-include==1.4.1
# hardcode pydantic version to avoid dependency conflict with copier
pip install pydantic==1.10.2
python -m copier --defaults . async-box-bot
# pip install pydantic==1.10.2
python -m copier copy --defaults --trust . async-box-bot
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down Expand Up @@ -140,20 +140,20 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10" ]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install copier
run: |
pip install copier==7.1.0
pip install copier==9.3.1
pip install copier-templates-extensions
pip install pyyaml-include==1.4.1
# hardcode pydantic version to avoid dependency conflict with copier
pip install pydantic==1.10.2
python -m copier --defaults . async-box-bot
# pip install pydantic==1.10.2
python -m copier copy --defaults --trust . async-box-bot
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down
2 changes: 2 additions & 0 deletions app/api/dependencies/healthcheck.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ async def check_db_connection(request: Request) -> Optional[str]:
return str(exc)

return None


check_db_connection_dependency = Depends(check_db_connection)


Expand Down
3 changes: 1 addition & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from fastapi import FastAPI
from pybotx import Bot, CallbackRepoProto
from redis import asyncio as aioredis

from app.api.routers import router
from app.bot.bot import get_bot
Expand All @@ -30,7 +29,7 @@ async def startup(bot: Bot) -> None:
bot.state.redis_repo = RedisRepo(
redis=redis_client, prefix=f"{BOT_PROJECT_NAME}{settings.CONTAINER_PREFIX}"
)

bot.state.redis = redis_client


async def shutdown(bot: Bot) -> None:
Expand Down
Loading

0 comments on commit bc14c5f

Please sign in to comment.