neuropercolation/.gitlab-ci.yml

31 lines
838 B
YAML
Raw Permalink Normal View History

image: "python:3.7"
before_script:
- python --version
2020-10-25 20:05:41 +00:00
- pip install coverage pytest pytest-cov pylint recordclass coverage coverage-badge pylint-exit anybadge
stages:
- Static Analysis
- Test
pylint:
stage: Static Analysis
script:
2020-10-25 20:03:46 +00:00
- mkdir ./pylint
- pylint --output-format=text -d C0301 cellular_automaton/*.py | 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/
test:
stage: Test
script:
- pytest --cov=cellular_automaton tests/
- coverage report -m
- coverage-badge
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'