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-07-21 21:37:52 +02:00
|
|
|
platform: linux/amd64
|
|
|
|
|
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:
|
2022-06-23 12:06:18 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
2022-05-12 23:27:09 +02:00
|
|
|
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:
|
2022-06-23 12:06:18 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
2022-05-12 23:27:09 +02:00
|
|
|
pull: true
|
|
|
|
commands:
|
2022-07-19 01:06:42 +02:00
|
|
|
- python3 -m black --check --diff .
|
2022-06-20 14:31:41 +02:00
|
|
|
|
|
|
|
# check imports - python
|
|
|
|
test-isort:
|
2022-06-23 12:06:18 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
2022-06-20 14:31:41 +02:00
|
|
|
pull: true
|
|
|
|
commands:
|
2022-07-19 01:06:42 +02:00
|
|
|
- python3 -m isort --check-only --diff .
|
2022-06-20 14:31:41 +02:00
|
|
|
|
2022-07-21 20:55:35 +02:00
|
|
|
# check unused and missing imports - python
|
2022-07-15 14:10:17 +02:00
|
|
|
test-autoflake:
|
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
|
|
pull: true
|
|
|
|
commands:
|
2022-07-19 01:06:42 +02:00
|
|
|
- python3 -m autoflake --remove-all-unused-imports -r -v mangadlp/
|
|
|
|
- python3 -m autoflake --check --remove-all-unused-imports -r -v mangadlp/
|
2022-07-15 14:10:17 +02:00
|
|
|
|
2022-06-20 14:31:41 +02:00
|
|
|
# check static typing - python
|
|
|
|
test-mypy:
|
2022-06-23 12:06:18 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
2022-06-20 14:31:41 +02:00
|
|
|
pull: true
|
|
|
|
commands:
|
2022-07-19 01:06:42 +02:00
|
|
|
- python3 -m mypy --install-types --non-interactive mangadlp/
|
2022-05-12 23:27:09 +02:00
|
|
|
|
2022-07-21 20:55:35 +02:00
|
|
|
# mccabe, pycodestyle, pyflakes tests - python
|
2022-07-21 20:39:56 +02:00
|
|
|
test-pylama:
|
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
|
|
pull: true
|
|
|
|
commands:
|
|
|
|
- python3 -m pylama mangadlp/
|
|
|
|
|
2022-07-21 20:55:35 +02:00
|
|
|
# pylint test - python
|
|
|
|
test-pylint:
|
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
|
|
pull: true
|
|
|
|
commands:
|
|
|
|
- python3 -m pylint --fail-under 9 mangadlp/
|
|
|
|
|
|
|
|
# test code with different python versions - python
|
2022-06-25 15:21:10 +02:00
|
|
|
test-tox-pytest:
|
2022-06-26 17:56:48 +02:00
|
|
|
when:
|
|
|
|
event: [ push ]
|
2022-07-19 01:13:04 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
2022-05-12 23:27:09 +02:00
|
|
|
pull: true
|
|
|
|
commands:
|
2022-07-19 01:06:42 +02:00
|
|
|
- python3 -m tox -e basic
|
2022-06-25 15:21:10 +02:00
|
|
|
|
2022-07-21 20:55:35 +02:00
|
|
|
# generate coverage report - python
|
2022-06-25 15:21:10 +02:00
|
|
|
test-tox-coverage:
|
|
|
|
when:
|
|
|
|
branch: master
|
2022-06-26 17:56:48 +02:00
|
|
|
event: [ pull_request ]
|
2022-07-19 01:13:04 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
2022-06-25 15:21:10 +02:00
|
|
|
pull: true
|
|
|
|
commands:
|
2022-07-19 01:06:42 +02:00
|
|
|
- python3 -m tox -e coverage
|
2022-05-12 23:27:09 +02:00
|
|
|
|
|
|
|
# analyse code with sonarqube and upload it
|
|
|
|
sonarqube-analysis:
|
2022-05-13 23:14:10 +02:00
|
|
|
when:
|
|
|
|
branch: master
|
2022-06-26 17:56:48 +02:00
|
|
|
event: [ pull_request ]
|
2022-06-23 12:06:18 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/sonar-scanner
|
2022-05-12 23:27:09 +02:00
|
|
|
pull: true
|
|
|
|
settings:
|
2022-06-21 17:16:52 +02:00
|
|
|
sonar_host: https://sonarqube.44net.ch
|
2022-05-12 23:27:09 +02:00
|
|
|
sonar_token:
|
|
|
|
from_secret: sq-44net-token
|
|
|
|
usingProperties: true
|