manga-dlp/.woodpecker/tests.yml

63 lines
1.3 KiB
YAML
Raw Normal View History

2022-05-12 23:27:09 +02:00
##############################
# code testing and analysis #
#############################
2022-05-13 00:46:56 +02:00
# branch: all
# event: all
2022-05-12 23:27:09 +02:00
2022-05-13 11:49:13 +02:00
clone:
git:
image: woodpeckerci/plugin-git
2022-05-12 23:27:09 +02:00
pipeline:
2022-06-20 14:31:41 +02:00
# check code style - shell
2022-05-12 23:27:09 +02:00
test-shfmt:
image: 'cr.44net.ch/drone-plugins/test'
pull: true
commands:
- shfmt -d -i 4 -bn -ci -sr .
2022-06-20 14:31:41 +02:00
# check code style - python
2022-05-12 23:27:09 +02:00
test-black:
image: 'cr.44net.ch/drone-plugins/test'
pull: true
commands:
2022-06-20 14:31:41 +02:00
- black --check --diff .
# check imports - python
test-isort:
image: 'cr.44net.ch/drone-plugins/test'
pull: true
commands:
2022-06-21 12:52:09 +02:00
- isort --check-only --diff .
2022-06-20 14:31:41 +02:00
# check static typing - python
test-mypy:
image: 'cr.44net.ch/drone-plugins/test'
pull: true
commands:
2022-06-21 12:52:09 +02:00
- mypy --install-types --non-interactive mangadlp/
2022-05-12 23:27:09 +02:00
# 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
2022-06-21 12:52:09 +02:00
- coverage run
2022-05-12 23:27:09 +02:00
- coverage xml -i
# analyse code with sonarqube and upload it
sonarqube-analysis:
2022-05-13 23:14:10 +02:00
when:
branch: master
2022-05-12 23:27:09 +02:00
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