Sith/.gitlab-ci.yml

50 lines
1.2 KiB
YAML
Raw Normal View History

2018-10-04 19:16:02 +00:00
stages:
- test
# Installs and launch unittests
unittests:
2018-10-04 19:35:39 +00:00
stage: test
2016-04-18 02:58:15 +00:00
script:
# Install dependencies
2016-11-08 18:17:42 +00:00
- apt-get update
- apt-get install -y gettext libxapian-dev libgraphviz-dev
2022-02-28 09:34:15 +00:00
- pip install poetry
# Check pyproject.toml validity
- poetry check
# Install project
- poetry install -E testing -E docs
# Setup xapian index
- mkdir -p /dev/shm/search_indexes
- ln -s /dev/shm/search_indexes sith/search_indexes
# Setup project
2022-02-28 09:34:15 +00:00
- poetry run ./manage.py compilemessages
# Run tests and export report
2022-02-28 09:34:15 +00:00
- poetry run coverage run ./manage.py test
- poetry run coverage html
- poetry run coverage report
# Build documentation
- cd doc
- poetry run make html
2021-09-30 09:07:00 +00:00
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_tests"
cache:
paths:
- .cache/pip_tests
artifacts:
paths:
- coverage_report/
- docs/_build
2018-10-04 19:16:02 +00:00
# Check black
2018-10-04 19:16:02 +00:00
black:
stage: test
script:
- version=$(cat pyproject.toml | grep --color=never black | grep --color=never -oE '[0-9]([0-9.a-z]+)')
- pip install black==$version
2018-10-04 19:16:02 +00:00
- black --check .
2021-09-30 09:07:00 +00:00
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_black"
cache:
paths:
- .cache/pip_black