Add linting pipeline. Add status badge
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/deploy unknown status
ci/woodpecker/push/linting Pipeline failed

This commit is contained in:
RealStickman 2022-09-12 17:31:22 +02:00
parent 8549ee00c6
commit aff5a109cf
11 changed files with 45 additions and 13 deletions

View File

@ -1,10 +1,14 @@
pipeline: pipeline:
build: build:
image: python:3.10 image: python:latest
commands: commands:
- pip install -U build - python --version
- build --version - pip install -U virtualenv --quiet
- virtualenv venv
- source venv/bin/activate
- pip install -U build --quiet
- build - build
when:
when:
event: tag event: tag
branch: [main, master] branch: [main, master]

View File

@ -1,9 +1,12 @@
pipeline: pipeline:
deploy: deploy:
image: python:3.10 image: python:latest
commands: commands:
- pip install -U twine - python --version
- twine --version - pip install -U virtualenv --quiet
- virtualenv venv
- source venv/bin/activate
- pip install -U twine --quiet
- twine upload --skip-existing --repository testpypi -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/* - twine upload --skip-existing --repository testpypi -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*
depends_on: depends_on:

23
.woodpecker/linting.yml Normal file
View File

@ -0,0 +1,23 @@
# https://woodpecker-ci.org/docs/usage/pipeline-syntax
pipeline:
typecheck:
image: python:latest
group: linting
commands:
- python --version
- pip install -U virtualenv --quiet
- virtualenv venv
- source venv/bin/activate
- pip install -U pyright --quiet
- pyright woodpeckerpy/main.py
format:
image: python:latest
group: linting
commands:
- python --version
- pip install -U virtualenv --quiet
- virtualenv venv
- source venv/bin/activate
- pip install -U black --quiet
- black woodpeckerpy/main.py

View File

@ -1 +1,3 @@
# Woodpecker Python Test # Woodpecker Python Test
![Status badge](https://woodpecker.exu.li/api/badges/woodpecker-test/python/status.svg)

View File

@ -28,8 +28,8 @@ dependencies = [
[tool.hatch.build] [tool.hatch.build]
include = [ include = [
"woodpecker/*.py", "woodpeckerpy/*.py",
"woodpecker/py.typed" "woodpeckerpy/py.typed"
] ]
exclude = [] exclude = []

4
run.py
View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import woodpecker import woodpeckerpy
woodpecker.main() woodpeckerpy.main()