[QG] Add quality gates on main branch
[+] add lint pipeline for ruff isort and black checks [+] add types pipeline for mypy check [+] add tests pipeline for pytest check with coverage less 70% blocker QG [+] add some tests fo QG pass
This commit is contained in:
13
.woodpecker/lints.yaml
Normal file
13
.woodpecker/lints.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
branch: main
|
||||
|
||||
steps:
|
||||
- name: lint
|
||||
image: python:3.11
|
||||
commands:
|
||||
- pip install uv
|
||||
- uv sync --no-dev --only-group lints
|
||||
- uv run black --check .
|
||||
- uv run ruff check .
|
||||
- uv run isort --check-only .
|
||||
@@ -1,33 +0,0 @@
|
||||
when:
|
||||
- event: push
|
||||
branch: main
|
||||
- event: pull_request
|
||||
branch: main
|
||||
|
||||
steps:
|
||||
- name: install-deps
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- pip install --upgrade pip
|
||||
- pip install flake8 black isort # можно добавить pylint, mypy и др.
|
||||
|
||||
- name: flake8
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- flake8 . --max-line-length=120 --exclude=.venv,venv,__pycache__
|
||||
|
||||
- name: black
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- black --check --diff .
|
||||
|
||||
- name: isort
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- isort --check-only --diff .
|
||||
|
||||
- name: mypy
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- pip install mypy
|
||||
- mypy .
|
||||
@@ -1,19 +0,0 @@
|
||||
when:
|
||||
- event: push
|
||||
branch: main
|
||||
- event: pull_request
|
||||
branch: main
|
||||
|
||||
steps:
|
||||
- name: install
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- pip install --upgrade pip
|
||||
- pip install pytest pytest-cov coverage
|
||||
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
|
||||
- name: test
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- pytest --cov=src --cov-report=term --cov-report=xml tests/
|
||||
|
||||
12
.woodpecker/tests.yaml
Normal file
12
.woodpecker/tests.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
branch: main
|
||||
|
||||
steps:
|
||||
- name: tests
|
||||
image: python:3.11
|
||||
commands:
|
||||
- pip install uv
|
||||
- uv sync --no-dev --group tests
|
||||
- uv run pytest --cov=app --cov-fail-under=70 --cov-report=term-missing
|
||||
|
||||
11
.woodpecker/types.yaml
Normal file
11
.woodpecker/types.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
when:
|
||||
- event: [push, pull_request]
|
||||
branch: main
|
||||
|
||||
steps:
|
||||
- name: types
|
||||
image: python:3.11
|
||||
commands:
|
||||
- pip install uv
|
||||
- uv sync --no-dev --only-group types
|
||||
- uv run mypy .
|
||||
Reference in New Issue
Block a user