105 lines
2.5 KiB
YAML
105 lines
2.5 KiB
YAML
##############################
|
|
# code testing and analysis #
|
|
#############################
|
|
# branch: all
|
|
# event: all
|
|
|
|
platform: linux/amd64
|
|
|
|
clone:
|
|
git:
|
|
image: woodpeckerci/plugin-git:v1.6.0
|
|
|
|
pipeline:
|
|
|
|
# check code style - shell
|
|
test-shfmt:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- shfmt -d -i 4 -bn -ci -sr .
|
|
|
|
# check code style - python
|
|
test-black:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m black --check --diff .
|
|
|
|
# check imports - python
|
|
test-isort:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m isort --check-only --diff .
|
|
|
|
# check unused and missing imports - python
|
|
test-autoflake:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m autoflake --remove-all-unused-imports -r -v mangadlp/
|
|
- python3 -m autoflake --check --remove-all-unused-imports -r -v mangadlp/
|
|
|
|
# check static typing - python
|
|
test-mypy:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m mypy --install-types --non-interactive mangadlp/
|
|
|
|
# mccabe, pycodestyle, pyflakes tests - python
|
|
test-pylama:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m pylama mangadlp/
|
|
|
|
# pylint test - python
|
|
test-pylint:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m pip install -r requirements.txt
|
|
- python3 -m pylint --fail-under 9 mangadlp/
|
|
|
|
# test mkdocs generation
|
|
test-mkdocs:
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m pip install mkdocs
|
|
- cd docs || exit 1
|
|
- python3 -m mkdocs build --strict
|
|
|
|
# test code with different python versions - python
|
|
test-tox-pytest:
|
|
when:
|
|
event: [ push ]
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m tox -e basic
|
|
|
|
# generate coverage report - python
|
|
test-tox-coverage:
|
|
when:
|
|
branch: master
|
|
event: [ pull_request ]
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
pull: true
|
|
commands:
|
|
- python3 -m tox -e coverage
|
|
|
|
# analyse code with sonarqube and upload it
|
|
sonarqube-analysis:
|
|
when:
|
|
branch: master
|
|
event: [ pull_request ]
|
|
image: cr.44net.ch/ci-plugins/sonar-scanner
|
|
pull: true
|
|
settings:
|
|
sonar_host: https://sonarqube.44net.ch
|
|
sonar_token:
|
|
from_secret: sq-44net-token
|
|
usingProperties: true
|