Ivan Schaller
78da547898
All checks were successful
ci/woodpecker/push/tests Pipeline was successful
62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
##############################
|
|
# code testing and analysis #
|
|
#############################
|
|
# branch: all
|
|
# event: all
|
|
|
|
clone:
|
|
git:
|
|
image: woodpeckerci/plugin-git
|
|
|
|
pipeline:
|
|
|
|
# check code style - shell
|
|
test-shfmt:
|
|
image: 'cr.44net.ch/drone-plugins/test'
|
|
pull: true
|
|
commands:
|
|
- shfmt -d -i 4 -bn -ci -sr .
|
|
|
|
# check code style - python
|
|
test-black:
|
|
image: 'cr.44net.ch/drone-plugins/test'
|
|
pull: true
|
|
commands:
|
|
- black --check --diff .
|
|
|
|
# check imports - python
|
|
test-isort:
|
|
image: 'cr.44net.ch/drone-plugins/test'
|
|
pull: true
|
|
commands:
|
|
- isort --skip-gitignore --line-length 88 --profile black --check-only --diff .
|
|
|
|
# check static typing - python
|
|
test-mypy:
|
|
image: 'cr.44net.ch/drone-plugins/test'
|
|
pull: true
|
|
commands:
|
|
- mypy --install-types --non-interactive --show-error-context --show-column-numbers --show-error-codes --ignore-missing-imports mangadlp/
|
|
|
|
# test code and generate coverage report
|
|
test-coverage-pytest:
|
|
image: 'cr.44net.ch/drone-plugins/test'
|
|
pull: true
|
|
commands:
|
|
- pip install -r requirements.txt
|
|
- coverage erase
|
|
- coverage run -m pytest --verbose --exitfirst
|
|
- coverage xml -i
|
|
|
|
# analyse code with sonarqube and upload it
|
|
sonarqube-analysis:
|
|
when:
|
|
branch: master
|
|
image: 'cr.44net.ch/drone-plugins/sonarqube'
|
|
pull: true
|
|
settings:
|
|
sonar_host: 'https://sonarqube.44net.ch'
|
|
sonar_token:
|
|
from_secret: sq-44net-token
|
|
usingProperties: true
|
|
|