diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37a6ef3..577f060 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,10 +20,33 @@ formatter: - pip install black - 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: stage: Test 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: stage: AdditionalTests