Skip to content

Commit

Permalink
build scripts refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdanbobrowski committed Dec 17, 2024
1 parent 9056db5 commit 864ffdf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry
poetry install --with=dev
pip install '.[dev]'
- name: Run Ruff linter and code formatter
run: |
poetry run ruff format . --check
poetry run ruff check .
ruff format . --check
ruff check .
- name: Static code analysys with mypy
run: |
poetry run mypy .
mypy .
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry
poetry install --with=dev
pip install '.[dev]'
- name: Unit tests
run: |
poetry run pytest ./tests/unit
pytest ./tests/unit
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
.PHONY: format, check, test, integration_test, unit_test, unit_coverage, unit_coverage_html, clear_win

format:
poetry run ruff format .
poetry run ruff check . --fix
ruff format .
ruff check . --fix

check:
poetry run mypy .
mypy .

test:
poetry run pytest tests -s
pytest tests -s

integration_test:
poetry run pytest tests/integration -s
pytest tests/integration -s

unit_test:
poetry run pytest tests/unit -s
pytest tests/unit -s

unit_coverage:
poetry run pytest --cov=blog2epub ./tests/unit
pytest --cov=blog2epub ./tests/unit

unit_coverage_html:
poetry run pytest --cov=blog2epub --cov-report=html ./tests/unit
pytest --cov=blog2epub --cov-report=html ./tests/unit

clear_win:
del *.epub
Expand Down

0 comments on commit 864ffdf

Please sign in to comment.