Не подтверждена Коммит bcc33311 создал по автору Grigoriev Semyon's avatar Grigoriev Semyon Зафиксировано автором GitHub
Просмотр файлов

Pytest cov (#7)

* pytest cov

* tests
владелец dbb655df
name: Python package
on:
pull_request:
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up docker
uses: docker-practice/actions-setup-docker@master
- name: Run postgres
run: |
docker run -d -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust --name db-test postgres:15-alpine
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m ensurepip
python -m pip install --upgrade --no-cache-dir pip
python -m pip install --upgrade --no-cache-dir -r requirements.txt -r requirements.dev.txt
- name: Migrate DB
run: |
DB_DSN=postgresql://postgres@localhost:5432/postgres alembic upgrade head
- name: Build coverage file
run: |
DB_DSN=postgresql://postgres@localhost:5432/postgres pytest --cache-clear --showlocals --cov={{cookiecutter.module_name}} tests > pytest-coverage.txt
- name: Print report
if: always()
run: |
cat pytest-coverage.txt
- name: Comment coverage
uses: coroo/pytest-coverage-commentator@v1.0.2
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать