2020-10-20 10:14:05 +00:00
|
|
|
image: "python:3.7"
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- python --version
|
|
|
|
- pip install coverage pytest pytest-cov pylint recordclass coverage coverage-badge
|
|
|
|
|
|
|
|
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/
|
2020-10-20 10:14:05 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
stage: Test
|
|
|
|
script:
|
|
|
|
- pytest --cov=cellular_automaton tests/
|
|
|
|
- coverage report -m
|
|
|
|
- coverage-badge
|
|
|
|
|
|
|
|
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
|