Update .gitlab-ci.yml file

This commit is contained in:
appel_c 2023-11-08 18:18:23 +01:00
parent b5fa9a8fb4
commit a14223cc7c

View File

@ -20,10 +20,33 @@ formatter:
- pip install black - pip install black
- black --check --diff --color --line-length=100 ./ - black --check --diff --color --line-length=100 ./
pylint:
stage: Formatter
script:
- pip install pylint pylint-exit anybadge
- pip install -e .[dev]
- mkdir ./pylint
- pylint ./ophyd_devices --output-format=text --output=./pylint/pylint.log | tee ./pylint/pylint.log || pylint-exit $?
- PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
- anybadge --label=Pylint --file=pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green
- echo "Pylint score is $PYLINT_SCORE"
artifacts:
paths:
- ./pylint/
expire_in: 1 week
pytest: pytest:
stage: Test stage: Test
script: script:
- pytest -v --random-order ./tests - pip install coverage
- coverage run --source=./ophyd_devices -m pytest -v --junitxml=report.xml --random-order --full-trace ./tests
- coverage report
- coverage xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
junit: report.xml
cobertura: coverage.xml
tests-3.9: tests-3.9:
stage: AdditionalTests stage: AdditionalTests