54 lines
895 B
YAML
54 lines
895 B
YAML
|
image: python:latest
|
||
|
|
||
|
variables:
|
||
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||
|
|
||
|
cache:
|
||
|
paths:
|
||
|
- .cache/pip
|
||
|
- venv/
|
||
|
|
||
|
before_script:
|
||
|
- python --version
|
||
|
- pip install virtualenv
|
||
|
- virtualenv venv
|
||
|
- source venv/bin/activate
|
||
|
|
||
|
black:
|
||
|
stage: test
|
||
|
script:
|
||
|
- pip install black
|
||
|
- make black
|
||
|
|
||
|
flake8:
|
||
|
stage: test
|
||
|
script:
|
||
|
- pip install flake8
|
||
|
- make flake8
|
||
|
|
||
|
pytest:
|
||
|
stage: test
|
||
|
script:
|
||
|
- pip install hypothesis pytest pytest-cov
|
||
|
- make check
|
||
|
artifacts:
|
||
|
when: always
|
||
|
reports:
|
||
|
junit: report.xml
|
||
|
|
||
|
test_coverage:
|
||
|
stage: test
|
||
|
script:
|
||
|
- pip install hypothesis pytest pytest-cov
|
||
|
- coverage run -m pytest
|
||
|
- coverage report
|
||
|
- coverage xml
|
||
|
coverage: '/TOTAL.*\s([.\d]+)%/'
|
||
|
artifacts:
|
||
|
when: always
|
||
|
reports:
|
||
|
junit: report.xml
|
||
|
coverage_report:
|
||
|
coverage_format: cobertura
|
||
|
path: coverage.xml
|