Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
32 changes: 32 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Checking code quality

on: [push, pull_request]

jobs:

ci-qlty:

runs-on: ubuntu-latest

container: fedorapython/fedora-python-tox:latest

strategy:
fail-fast: false

steps:

- name: Checkout the codebase current state
uses: actions/checkout@v4

- name: Install the base dependencies
run: |
python3 -m pip install --upgrade poetry tox

- name: Check the correctness of the project config
run: |
poetry check

- name: Check the quality of the code
run: |
tox -e cleaning
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Checking code functionality

on: [push, pull_request]

jobs:

ci-qlty:

runs-on: ubuntu-latest

container: fedorapython/fedora-python-tox:latest

strategy:
fail-fast: false
matrix:
tox-env: ["py312"]

steps:

- name: Checkout the codebase current state
uses: actions/checkout@v4

- name: Install the base dependencies
run: |
python3 -m pip install --upgrade poetry tox

- name: Copy the default database, server and alembic configuration files
run: |
mv fastapi_ecom/config/config.py.example fastapi_ecom/config/config.py
mv fastapi_ecom/migrations/alembic.ini.example fastapi_ecom/migrations/alembic.ini

- name: Check the functionality of the code
run: |
tox -e ${{ matrix.tox-env }}
6 changes: 3 additions & 3 deletions fastapi_ecom/config/config.py.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# The database name
database = ""
database = "test_db"

# The username for the database user
username = ""
username = "test_user"

# The password for the database user
password = ""
password = "test_pwd"

# The location of serving the database service
dtbsbhost = "localhost"
Expand Down
9 changes: 7 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{311,312}
envlist = py{311,312},cleaning
isolated_build = true

[testenv]
Expand All @@ -10,6 +10,11 @@ set_env =
allowlist_externals =
poetry
commands_pre =
pip3 install --upgrade poetry
poetry install --all-extras
commands =
poetry run pytest -vvvv --cov=fastapi_ecom --cov-report=html --cov-report=xml --cov-report=term-missing tests {posargs}
poetry run pytest -vvvv --cov=fastapi_ecom --cov-report=html --cov-report=xml --cov-report=term-missing tests {posargs}

[testenv:cleaning]
commands =
poetry run ruff check fastapi_ecom/ tests/