Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
3ea330b
chore: project skeleton with Docker, env, and docs
Arch0998 Sep 20, 2025
3312323
Merge pull request #1 from Arch0998/feature/project-skeleton
Arch0998 Sep 20, 2025
23c1ea8
feat(users): add custom User model
PavelSemenikhin Sep 20, 2025
dd3e3ee
feat(users): configure custom User model in settings and add initial …
PavelSemenikhin Sep 20, 2025
150b238
feat(users): expanded custom User model with email-based authenticati…
PavelSemenikhin Sep 20, 2025
eaaa874
feat(users): added serializers for registration and user profile with…
PavelSemenikhin Sep 20, 2025
00b9f87
test(users): add tests for user creation, update, email update and em…
PavelSemenikhin Sep 20, 2025
3c375bb
test(users): test for string representation of user model
PavelSemenikhin Sep 20, 2025
c0f980d
style(users): fix imports and code style requirements
PavelSemenikhin Sep 21, 2025
1f54f55
created book model
viannik Sep 21, 2025
256c7a0
Merge pull request #2 from Arch0998/feature/user-service
Arch0998 Sep 21, 2025
aa4f0f0
added initial migration for Book model
viannik Sep 21, 2025
a5fca66
registered book model in admin panel
viannik Sep 21, 2025
839be3b
validated daily_fee ≥ 0
viannik Sep 21, 2025
91ed424
added tests for model constraints
viannik Sep 21, 2025
dc92bd6
enhanced Book model
viannik Sep 21, 2025
efce2c0
added enhanced migration for Book model
viannik Sep 22, 2025
6816846
enhanced BookAdmin model
viannik Sep 22, 2025
4ffb2ba
fix: update CI workflow
Arch0998 Sep 22, 2025
03abe83
fix: streamline health check command in CI workflow
Arch0998 Sep 22, 2025
a79e923
fix: reorder environment variables
Arch0998 Sep 22, 2025
f55abc4
create Borrowing model in borrowings app
Sep 22, 2025
592d4d1
fix: format code for consistency in admin, serializers, and test files
Arch0998 Sep 22, 2025
a01efcf
fix: set DJANGO_SETTINGS_MODULE in CI workflow
Arch0998 Sep 22, 2025
9fc1094
add str and class Meta with constraints in Borrowing model
Sep 22, 2025
e6aff72
fix: add environment variables for Django and PostgreSQL
Arch0998 Sep 22, 2025
d78975c
register Borrowing model in admin.py
Sep 22, 2025
656038c
implemented BookSerializer
viannik Sep 22, 2025
5557dad
add migration
Sep 22, 2025
1c6c4e8
fix: add pytest-django to requirements and optimize imports in test f…
Arch0998 Sep 22, 2025
7a47245
fix: update CI workflow (#4)
Arch0998 Sep 22, 2025
5faf614
Merge remote-tracking branch 'origin/fix/ci-workflow' into feature/bo…
viannik Sep 22, 2025
d60c93d
flake8 fix models.py in borrowing app
Sep 22, 2025
0a183f1
feat(users): add CreateUserViewSet and ManageUserViewSet with permiss…
PavelSemenikhin Sep 22, 2025
e80d869
Add initial migration for `Payment` model with constraints and enum f…
Artcrafterrra Sep 22, 2025
5aedb20
black fix models.py in borrowing app
Sep 22, 2025
8c7d8ec
feat(users): add unique email validation for registration
PavelSemenikhin Sep 22, 2025
545e634
Integrate `PaymentViewSet` with URL routing using `SimpleRouter`
Artcrafterrra Sep 22, 2025
462b932
test(users): test for success user register that returns user without…
PavelSemenikhin Sep 22, 2025
5445f02
Add `Payment` model with validations, admin support, and tests
Artcrafterrra Sep 22, 2025
3331007
update files
Sep 22, 2025
591a198
Format code in `PaymentStatus` and fix newline issue in tests
Artcrafterrra Sep 22, 2025
e0931a1
fix: url to default
Artcrafterrra Sep 22, 2025
8ecb164
Add PaymentSerializer for Payment model validation
Artcrafterrra Sep 22, 2025
38754bc
Add PaymentSerializer for Payment model validation
Artcrafterrra Sep 22, 2025
59501fe
Introduce PaymentViewSet for Payment API functionality
Artcrafterrra Sep 22, 2025
bed0d1b
Integrate SimpleRouter for PaymentViewSet in payments URLs
Artcrafterrra Sep 22, 2025
e775214
Merge pull request #8 from Arch0998/feature/user-registration
Arch0998 Sep 22, 2025
bdca6f8
implemented BookViewSet
viannik Sep 22, 2025
10f4fb5
added books router endpoint
viannik Sep 22, 2025
d00094f
configured books pagination
viannik Sep 22, 2025
8381580
added tests for unauthenticated access to book list
viannik Sep 22, 2025
6834410
Merge pull request #7 from Arch0998/feature/payments-model
Arch0998 Sep 22, 2025
e330820
added default filters and pagination settings
viannik Sep 22, 2025
f22f2e4
fix formatting
viannik Sep 22, 2025
79c00a6
Merge pull request #6 from Arch0998/feature/book/model
Arch0998 Sep 22, 2025
78c944a
update files
Sep 22, 2025
29d52c0
Merge remote-tracking branch 'origin/develop' into feature/4.0.1-Paym…
Artcrafterrra Sep 22, 2025
98b8be0
fix: resolve formatting issues in `payments` app URLs and views
Artcrafterrra Sep 22, 2025
c86497e
Merge branch 'develop' into feature/book/list
viannik Sep 22, 2025
f9828f5
add Borrowing admin with list display, filters, search
Sep 22, 2025
3cfd3bb
feat(users): configured SimpleJWT in settings.py
PavelSemenikhin Sep 22, 2025
098a74f
extended permissions
viannik Sep 22, 2025
b7a5ae3
Merge remote-tracking branch 'origin/feature/book/list' into feature/…
viannik Sep 22, 2025
78f64bb
feat(users): configured Simple JWT additional settings (token lifetim…
PavelSemenikhin Sep 22, 2025
09e7d5c
Merge pull request #10 from Arch0998/feature/book/list
Arch0998 Sep 22, 2025
90a6522
test: add endpoint tests for Payment API and update serializer read-o…
Artcrafterrra Sep 22, 2025
8fa1148
test: add serializer tests for PaymentSerializer
Artcrafterrra Sep 22, 2025
944cd91
test: add view tests for PaymentViewSet
Artcrafterrra Sep 22, 2025
129bc9a
docs: add schema annotations to PaymentViewSet endpoints
Artcrafterrra Sep 22, 2025
1be33c5
feat(users): Add register and me endpoints for User
PavelSemenikhin Sep 22, 2025
709549f
test(users): add tests for JWT obtain and refresh token endpoints
PavelSemenikhin Sep 22, 2025
d12a9fa
add tests for borrowings model
Sep 22, 2025
1ed1d81
Merge branch 'develop' into feature/1.3-JWT
PavelSemenikhin Sep 22, 2025
55800f9
docs: add schema annotations to PaymentViewSet endpoints
Artcrafterrra Sep 22, 2025
0a50f91
docs: fix description formatting in PaymentViewSet schema
Artcrafterrra Sep 22, 2025
3535c5f
fix requirements.txt
PavelSemenikhin Sep 22, 2025
85a2734
fix requirements.txt
PavelSemenikhin Sep 22, 2025
a007f31
Merge remote-tracking branch 'origin/develop' into feature/payment-se…
Artcrafterrra Sep 22, 2025
da0d630
fix tests
Sep 22, 2025
8d0a59e
fix requirements.txt
PavelSemenikhin Sep 22, 2025
05563e4
fixed requirements.txt
PavelSemenikhin Sep 22, 2025
58535c0
black fix
Sep 22, 2025
e76435c
test: update tests to handle paginated response data in payments APIs
Artcrafterrra Sep 22, 2025
d1a5fc6
fixed requirements.txt
PavelSemenikhin Sep 22, 2025
dbac703
Merge pull request #9 from Arch0998/feature/borrowing-model
Arch0998 Sep 22, 2025
6f92794
Merge pull request #13 from Arch0998/feature/payment-servise
Arch0998 Sep 22, 2025
95e16b8
Merge pull request #11 from Arch0998/feature/1.3-JWT
Arch0998 Sep 22, 2025
e1ced2e
refactor: replace `borrowing_id` with `borrowing` relationship across…
Artcrafterrra Sep 22, 2025
e35194c
delete tests.py in borrowings app
Sep 22, 2025
f2f4fb3
refactor: apply consistent formatting across tests, models, and seria…
Artcrafterrra Sep 22, 2025
6357963
Merge pull request #15 from Arch0998/fix/test
viannik Sep 22, 2025
96d2eb6
docs: fix formatting in comments within `payments` models
Artcrafterrra Sep 22, 2025
2c47459
added book detail tests
viannik Sep 22, 2025
2ff6701
Merge remote-tracking branch 'origin/develop' into feature/book/detail
viannik Sep 22, 2025
1312e19
fix: filter payments queryset by borrowing user for authenticated non…
Artcrafterrra Sep 22, 2025
42552a9
added IsStaff permission
viannik Sep 22, 2025
890bdb1
added tests for different user roles
viannik Sep 22, 2025
4b7238a
Merge pull request #16 from Arch0998/feature/book/detail
viannik Sep 22, 2025
80f89d3
Merge branch 'develop' into feature/book/create
viannik Sep 22, 2025
2bb5fbf
test(users): add tests for profile view and update (authorized and un…
PavelSemenikhin Sep 23, 2025
494b3cb
Merge pull request #19 from Arch0998/feature/1.4-profile-system
Arch0998 Sep 23, 2025
d8ce7b9
Merge pull request #14 from Arch0998/fix/conection-to-borrowing
Arch0998 Sep 23, 2025
edcae86
Merge pull request #18 from Arch0998/feature/book/create
Arch0998 Sep 23, 2025
6d9cc2b
refactor: reorder installed apps in base.py (#20)
Arch0998 Sep 23, 2025
c66b952
Merge remote-tracking branch 'origin/develop' into feature/payments-p…
Artcrafterrra Sep 23, 2025
caf158b
added tests for book updates
viannik Sep 23, 2025
73da75f
updated book router path
viannik Sep 23, 2025
1056cc7
migration
PavelSemenikhin Sep 23, 2025
1ce68a5
Merge pull request #21 from Arch0998/feature/book/update
Arch0998 Sep 23, 2025
40c84e9
fix: filter payments queryset by borrowing user for authenticated non…
Artcrafterrra Sep 23, 2025
439c926
feat(users): separated serializers for reading and updating
PavelSemenikhin Sep 23, 2025
794ec45
added tests for book delete
viannik Sep 23, 2025
6389a83
feat(users): add get_serializer_class to use different serializers pe…
PavelSemenikhin Sep 23, 2025
f3a44d1
fix: filter payments queryset by borrowing user for authenticated non…
Artcrafterrra Sep 23, 2025
3f996ec
code style changes
PavelSemenikhin Sep 23, 2025
c161836
feat(users): added action patch in router
PavelSemenikhin Sep 23, 2025
dfecf30
fix: remove duplicate CANCELLED status in PaymentStatus choices
Artcrafterrra Sep 23, 2025
7f8400f
feat(users): custom basic first and last name validation
PavelSemenikhin Sep 23, 2025
c695c77
Merge pull request #23 from Arch0998/feature/book/delete
Arch0998 Sep 23, 2025
8d64cf0
Merge pull request #22 from Arch0998/feature/payments-permissions
Arch0998 Sep 23, 2025
be2d44a
feat(users): added a test to check the read-only profile view and rep…
PavelSemenikhin Sep 23, 2025
2c6c768
test(users): add check for partial profile name update
PavelSemenikhin Sep 23, 2025
5bcf8b5
test(users): add PUT unauthorized test for /users/me/ endpoint
PavelSemenikhin Sep 23, 2025
0825bcc
test(users): add validation test for updating email to an existing one
PavelSemenikhin Sep 23, 2025
dcfae74
Merge branch 'develop' into feature/1.5-profile-managing
Arch0998 Sep 23, 2025
f1cf151
chore: update `.env.sample` with Stripe keys and add `stripe` to depe…
Artcrafterrra Sep 23, 2025
3cc7124
feat: add success and cancel views for Stripe payments and update set…
Artcrafterrra Sep 23, 2025
43d4488
refactor: apply consistent formatting across `payments` views and URLs
Artcrafterrra Sep 23, 2025
a3726d3
feat: implement Stripe checkout session creation helper in `payments`…
Artcrafterrra Sep 23, 2025
6d00d9e
feat: implement borrowing functionality with serializers, views, and …
Arch0998 Sep 23, 2025
982628c
test: add tests for borrowing serializers and views
Arch0998 Sep 23, 2025
55ff530
Merge pull request #24 from Arch0998/feature/1.5-profile-managing
Arch0998 Sep 23, 2025
f9321c9
Merge pull request #25 from Arch0998/feature/borrowings-complete
Arch0998 Sep 23, 2025
cec18d6
extended schema view
viannik Sep 23, 2025
47ee46b
migration
PavelSemenikhin Sep 23, 2025
075ea9f
feat(users): separated serializers for reading and updating
PavelSemenikhin Sep 23, 2025
b2566e0
feat(users): add get_serializer_class to use different serializers pe…
PavelSemenikhin Sep 23, 2025
ca6fb60
code style changes
PavelSemenikhin Sep 23, 2025
2a297d1
feat(users): added action patch in router
PavelSemenikhin Sep 23, 2025
66be623
feat(users): custom basic first and last name validation
PavelSemenikhin Sep 23, 2025
e7ca783
feat(users): added a test to check the read-only profile view and rep…
PavelSemenikhin Sep 23, 2025
77a3c4e
test(users): add check for partial profile name update
PavelSemenikhin Sep 23, 2025
8486144
test(users): add PUT unauthorized test for /users/me/ endpoint
PavelSemenikhin Sep 23, 2025
64f3e5e
test(users): add validation test for updating email to an existing one
PavelSemenikhin Sep 23, 2025
79e3852
added tests for book delete
viannik Sep 23, 2025
5b77435
fix: filter payments queryset by borrowing user for authenticated non…
Artcrafterrra Sep 22, 2025
52b8e41
fix: filter payments queryset by borrowing user for authenticated non…
Artcrafterrra Sep 23, 2025
b513d8f
fix: filter payments queryset by borrowing user for authenticated non…
Artcrafterrra Sep 23, 2025
f8b9024
fix: remove duplicate CANCELLED status in PaymentStatus choices
Artcrafterrra Sep 23, 2025
a91b019
feat: implement borrowing functionality with serializers, views, and …
Arch0998 Sep 23, 2025
ccff745
test: add tests for borrowing serializers and views
Arch0998 Sep 23, 2025
f6dc0c4
feat: add distinct serializers for Payment list and detail views
Artcrafterrra Sep 23, 2025
d370e3a
test: add unit tests for PaymentListSerializer
Artcrafterrra Sep 23, 2025
c4da624
feat: add Stripe environment variables to .env.sample
Artcrafterrra Sep 23, 2025
d262584
addet migration
Artcrafterrra Sep 23, 2025
266b787
refactor: comment out unused payment success and cancel URL paths
Artcrafterrra Sep 23, 2025
5b28637
refactor: reformat imports and improve code readability in payments m…
Artcrafterrra Sep 23, 2025
eac6ec5
feat: add PaymentSuccessView and PaymentCancelView to handle Stripe c…
Artcrafterrra Sep 23, 2025
4f531b5
feat: enable PaymentSuccessView and PaymentCancelView URL paths
Artcrafterrra Sep 23, 2025
f388333
refactor: switch to DefaultRouter, enhance readability, and update re…
Artcrafterrra Sep 23, 2025
5c9cf89
refactor: switch to DefaultRouter, enhance readability, and update re…
Artcrafterrra Sep 23, 2025
f701bec
Merge branch 'develop' into feature/stripe-integration
Artcrafterrra Sep 23, 2025
2ffc6b9
fix: correct indentation in payment cancellation response message
Artcrafterrra Sep 23, 2025
7d23755
feat: add Stripe environment variables to CI workflow and fix incorre…
Artcrafterrra Sep 23, 2025
d054650
Merge pull request #27 from Arch0998/feature/stripe-integration
Arch0998 Sep 23, 2025
21392a8
fix: added call create_stripe_session on creating new borrowing
Artcrafterrra Sep 23, 2025
364305b
refactor: standardize string quotes and formatting in borrowing payme…
Artcrafterrra Sep 23, 2025
bb9f0b7
Merge pull request #28 from Arch0998/feature/create-stripe-session-in…
Arch0998 Sep 23, 2025
4d7d56c
Merge pull request #26 from Arch0998/feature/book/schema
Arch0998 Sep 23, 2025
97c3566
feat: add `IsAuthenticated` permission to PaymentsView for access con…
Artcrafterrra Sep 23, 2025
b03ac94
test(users): swagger docs for users views.py
PavelSemenikhin Sep 23, 2025
b68e1b1
feat: add `IsAuthenticated` permission to PaymentsView for access con…
Artcrafterrra Sep 23, 2025
6c6854f
docs(borrowings): swagger docs for borrowings views.py
PavelSemenikhin Sep 23, 2025
f3d9453
code style fix
PavelSemenikhin Sep 23, 2025
3e8b9ff
Merge pull request #29 from Arch0998/fix/permitions-fix-to-payments
Arch0998 Sep 23, 2025
b78b575
Merge pull request #30 from Arch0998/feature/user-documentation
Arch0998 Sep 23, 2025
9f13489
fix: set custom database table names for Book, Borrowing, and User mo…
Arch0998 Sep 23, 2025
b8601b7
Merge pull request #31 from Arch0998/fix/fix-db-names
Arch0998 Sep 23, 2025
8b4adbc
feat: add fixture data for books and users
Arch0998 Sep 23, 2025
bb605a8
Merge pull request #32 from Arch0998/feature/fixture-for-db
Arch0998 Sep 23, 2025
cf58969
refactor: replace `borrowing_id` with `borrowing` in PaymentSerialize…
Artcrafterrra Sep 23, 2025
b728bc4
Merge pull request #33 from Arch0998/fix/payment-serializer
Arch0998 Sep 23, 2025
8c69492
feat: update environment sample and requirements
Arch0998 Sep 23, 2025
ed986ab
feat: add Telegram messaging for notifications
Arch0998 Sep 23, 2025
bf0c9f0
feat: add redis
Arch0998 Sep 23, 2025
51281d5
refactor: telegram_helper
Arch0998 Sep 23, 2025
58375fa
feat: integrate Celery with Redis
Arch0998 Sep 23, 2025
c67ebbb
feat: add notification for new borrowings and overdue checks
Arch0998 Sep 23, 2025
dc1e5cb
test: add tests for Telegram messaging
Arch0998 Sep 23, 2025
cbcc83f
fix: add Telegram bot configuration to CI
Arch0998 Sep 23, 2025
852e6f7
feat: add Redis service to CI and update test
Arch0998 Sep 23, 2025
3d367b7
test: fix
Arch0998 Sep 24, 2025
d2c639e
fix: test
Arch0998 Sep 24, 2025
b8688a0
Merge pull request #34 from Arch0998/feature/notifications
Arch0998 Sep 24, 2025
7d1f68d
feat: add return book action to BorrowingViewSet
Arch0998 Sep 24, 2025
c0ed093
Merge pull request #35 from Arch0998/feature/borrowings-return
Arch0998 Sep 24, 2025
b9b8641
feat: implement kostil Stripe webhook
Arch0998 Sep 24, 2025
45de27f
refactor: remove comment
Arch0998 Sep 24, 2025
a8e5916
Merge pull request #37 from Arch0998/feature/stripe-kostil-webhook
Arch0998 Sep 24, 2025
d059636
feat: enhance Telegram notifications
Arch0998 Sep 24, 2025
d3a6475
Merge pull request #38 from Arch0998/feature/telegram-paid
Arch0998 Sep 24, 2025
a13ee9b
refactor: adjust string formatting and improve readability in borrowi…
Artcrafterrra Sep 24, 2025
ff2f46f
refactor: fix indentation and adjust string formatting in borrowing a…
Artcrafterrra Sep 24, 2025
bff7431
Merge pull request #39 from Arch0998/feature/fine-logic-implementation
Arch0998 Sep 24, 2025
ad7f06d
add README.md
PavelSemenikhin Sep 24, 2025
22bd588
Merge pull request #40 from Arch0998/readme
Arch0998 Sep 24, 2025
5af41f6
update README.md
PavelSemenikhin Sep 24, 2025
094e9db
Merge pull request #41 from Arch0998/readme
Arch0998 Sep 24, 2025
47fa42e
refactor: delete empty files
Arch0998 Sep 25, 2025
44f9023
refactor: centralize Telegram configuration in base settings
Arch0998 Sep 25, 2025
95a06a7
refactor: remove notifications URL from routing
Arch0998 Sep 25, 2025
c54f4a7
refactor: clean up imports and remove unnecessary whitespace
Arch0998 Sep 25, 2025
8b9e362
refactor: add healthchecks for db, app, and redis services in docker-…
Arch0998 Sep 25, 2025
8200938
refactor: add type hints and clean up code across multiple files
Arch0998 Sep 25, 2025
7aa6c37
refactor: defer notification tasks until after database transactions
Arch0998 Sep 25, 2025
4fdf41f
fix: black
Arch0998 Sep 25, 2025
c23661c
refactor: replace APITestCase with TransactionTestCase
Arch0998 Sep 25, 2025
d8803b7
refactor: add `basename` to router registration and remove unused `qu…
Artcrafterrra Sep 25, 2025
7da0704
refactor: update healthcheck command in docker-compose, add `basename…
Artcrafterrra Sep 25, 2025
3c025a7
refactor: remove unused validation methods and tests in PaymentSerial…
Artcrafterrra Sep 25, 2025
1eb41df
test: add Stripe webhook and PaymentTestSuccessView tests for payment…
Artcrafterrra Sep 25, 2025
2f35830
test: standardize string quotes and formatting in Stripe tests for co…
Artcrafterrra Sep 25, 2025
dd24c04
refactor: replace `check` with `condition` in CheckConstraint for cla…
Artcrafterrra Sep 25, 2025
2232cfe
Merge pull request #42 from Arch0998/fix/refactoring-users-app
Arch0998 Sep 25, 2025
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
39 changes: 39 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Python cache
__pycache__/
*.pyc
*.pyo
*.pyd

# Python venv
venv/
.venv/

# SQLite DB
*.sqlite3
db.sqlite3

# Env files
.env
.env.*
*.env

# Logs
*.log

# Test & coverage
.mypy_cache/
.pytest_cache/
*.coverage
.coverage.*
htmlcov/

# Build artifacts
dist/
build/
*.egg-info/

# IDE & OS
.idea/
.vscode/
.DS_Store
*.swp
19 changes: 19 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Django settings
DJANGO_SECRET_KEY=
PRODUCTION_HOST=
DJANGO_SETTINGS_MODULE=core.settings.dev

# Database settings
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_HOST=
POSTGRES_PORT=

# Stripe settings
STRIPE_SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=

# Telegram Bot settings
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
inline-quotes = "
ignore = E203, E266, W503, N807, N818, F401
max-line-length = 79
max-complexity = 18
select = B,C,E,F,W,T4,B9,Q0,N8,VNE
exclude =
**migrations
**settings
venv
.venv
tests
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]

jobs:
test:
runs-on: ubuntu-latest
env:
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}
DJANGO_SETTINGS_MODULE: core.settings.dev
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: ${{ secrets.POSTGRES_DB }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres" --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov

- name: Run black
run: black --check .

- name: Run flake8
run: flake8 .

- name: Run tests with coverage
run: pytest --cov=.

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: .coverage
Loading
Loading