From 28ae109b32afe9f84b16614b135cbe4efb43791e Mon Sep 17 00:00:00 2001 From: Sli Date: Sat, 26 Mar 2022 21:27:20 +0000 Subject: [PATCH] Add missing dependencies and improve pipeline --- .gitlab-ci.yml | 21 +++++++++++++++++---- pyproject.toml | 2 ++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5be0b74..2f6dd6a4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,30 @@ stages: - test -test: +# Installs and launch unittests +unittests: stage: test script: - - env + # Install dependencies - apt-get update - apt-get install -y gettext libxapian-dev libgraphviz-dev - pip install poetry - - poetry install -E testing + # 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 - poetry run ./manage.py compilemessages + # Run tests and export report - poetry run coverage run ./manage.py test - poetry run coverage html - poetry run coverage report + # Build documentation + - cd doc + - poetry run make html variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_tests" cache: @@ -23,11 +33,14 @@ test: artifacts: paths: - coverage_report/ + - docs/_build +# Check black black: stage: test script: - - pip install -U black + - version=$(cat pyproject.toml | grep --color=never black | grep --color=never -oE '[0-9]([0-9.a-z]+)') + - pip install black==$version - black --check . variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_black" diff --git a/pyproject.toml b/pyproject.toml index 1d642a47..602786e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,8 +38,10 @@ libsass = "^0.21.0" django-ordered-model = "^3.4.3" django-simple-captcha = "^0.5.14" python-dateutil = "^2.8.2" +psycopg2-binary = "^2.9.1" sentry-sdk = "^1.4.3" graphviz = "^0.17" +Jinja2 = "<=3.0.3" # Extra optional dependencies mysqlclient = { version = "^2.0.3", optional = true }