31 lines
817 B
YAML
31 lines
817 B
YAML
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:
|
|
- 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}%)/'
|