46 lines
861 B
YAML
46 lines
861 B
YAML
image: python:3
|
|
|
|
stages:
|
|
- test
|
|
- deploy
|
|
|
|
# Change pip's cache directory to be inside the project directory since we can
|
|
# only cache local items.
|
|
variables:
|
|
POETRY_CACHE_DIR: "$CI_PROJECT_DIR/.cache/poetry"
|
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- .cache/pip
|
|
- .cache/poetry
|
|
|
|
before_script:
|
|
- python -V
|
|
- pip install poetry
|
|
- "poetry config settings.virtualenvs.path ${POETRY_CACHE_DIR}"
|
|
- poetry install
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- poetry run pytest . --cov=jeeves.core --cov-report xml --cov-report term
|
|
artifacts:
|
|
paths:
|
|
- coverage.xml
|
|
|
|
pages:
|
|
stage: deploy
|
|
dependencies:
|
|
- test
|
|
script:
|
|
- poetry run docs/build.sh
|
|
- mv docs/_build/html/ public
|
|
- coverage html --directory public/htmlcov
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- master
|