From aafc2e6e96f26dbaefec5ae950bbe0b32ca21685 Mon Sep 17 00:00:00 2001 From: Skia Date: Thu, 30 Sep 2021 10:48:08 +0200 Subject: [PATCH 1/2] gitlab-ci: put search_indexes in shared memory --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc2bcea5..0d758a09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ stages: test: stage: test script: + - env - apt-get update - apt-get install -y gettext python3-xapian libgraphviz-dev - pushd /usr/lib/python3/dist-packages/xapian && ln -s _xapian* _xapian.so && popd @@ -11,6 +12,8 @@ test: - python -c 'import xapian' # Fail immediately if there is a problem with xapian - pip install -r requirements.txt - pip install coverage + - mkdir -p /dev/shm/search_indexes + - ln -s /dev/shm/search_indexes sith/search_indexes - ./manage.py compilemessages - coverage run ./manage.py test - coverage html From 4119eefe37b0c352fe3123fddbb53f05b3e340aa Mon Sep 17 00:00:00 2001 From: Skia Date: Thu, 30 Sep 2021 11:07:00 +0200 Subject: [PATCH 2/2] gitlab-ci: keep pip cache between jobs --- .gitlab-ci.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0d758a09..9943ab73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,8 +10,8 @@ test: - pushd /usr/lib/python3/dist-packages/xapian && ln -s _xapian* _xapian.so && popd - export PYTHONPATH="/usr/lib/python3/dist-packages:$PYTHONPATH" - python -c 'import xapian' # Fail immediately if there is a problem with xapian - - pip install -r requirements.txt - - pip install coverage + - pip install -U -r requirements.txt + - pip install -U coverage - mkdir -p /dev/shm/search_indexes - ln -s /dev/shm/search_indexes sith/search_indexes - ./manage.py compilemessages @@ -20,6 +20,11 @@ test: - coverage report - cd doc - make html # Make documentation + variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_tests" + cache: + paths: + - .cache/pip_tests artifacts: paths: - coverage_report/ @@ -27,5 +32,10 @@ test: black: stage: test script: - - pip install black + - pip install -U black - black --check . + variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_black" + cache: + paths: + - .cache/pip_black