diff --git a/.woodpecker/python_lints.yaml b/.woodpecker/python_lints.yaml index b98b76f..a8f9f85 100644 --- a/.woodpecker/python_lints.yaml +++ b/.woodpecker/python_lints.yaml @@ -1,10 +1,33 @@ when: - event: push branch: main + - event: pull_request + branch: main steps: - - name: build - image: debian + - name: install-deps + image: python:3.11-slim commands: - - echo "This is the build step" - - echo "binary-data-123" > executable + - 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 . diff --git a/.woodpecker/test_pipeline.yaml b/.woodpecker/test_pipeline.yaml index b98b76f..1f50a25 100644 --- a/.woodpecker/test_pipeline.yaml +++ b/.woodpecker/test_pipeline.yaml @@ -1,10 +1,19 @@ when: - event: push branch: main + - event: pull_request + branch: main steps: - - name: build - image: debian + - name: install + image: python:3.11-slim commands: - - echo "This is the build step" - - echo "binary-data-123" > executable + - 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/ +