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:
|
2022-12-29 14:38:27 +01:00
|
|
|
image: woodpeckerci/plugin-git:v1.6.0
|
2022-05-13 11:49:13 +02:00
|
|
|
|
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:
|
2023-02-18 12:23:50 +01:00
|
|
|
- just test_shfmt
|
2022-05-12 23:27:09 +02:00
|
|
|
|
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:
|
2023-02-18 12:23:50 +01:00
|
|
|
- just test_black
|
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:
|
2023-02-18 12:23:50 +01:00
|
|
|
- just test_mypy
|
2022-07-21 20:39:56 +02:00
|
|
|
|
2023-02-18 16:21:03 +01:00
|
|
|
# check static typing - python
|
|
|
|
test-pyright:
|
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
|
|
pull: true
|
|
|
|
commands:
|
|
|
|
- just test_pyright
|
|
|
|
|
2023-02-18 12:23:50 +01:00
|
|
|
# ruff test - python
|
2023-02-18 12:32:30 +01:00
|
|
|
test-ruff:
|
2022-07-21 20:55:35 +02:00
|
|
|
image: cr.44net.ch/ci-plugins/tests
|
|
|
|
pull: true
|
|
|
|
commands:
|
2023-02-18 12:23:50 +01:00
|
|
|
- just test_ruff
|
2022-07-21 20:55:35 +02:00
|
|
|
|
2022-08-15 14:53:45 +02:00
|
|
|
# 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
|
|
|
|
|
2023-02-18 12:23:50 +01:00
|
|
|
# test code with pytest - 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:
|
2023-02-18 12:23:50 +01:00
|
|
|
- just test_pytest
|
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:
|
2023-02-18 12:23:50 +01:00
|
|
|
- just test_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
|