Merge branch 'skia/ci_speedup' into 'master'

CI speedup

* Put the Xapian search index in `/dev/shm`, which is an in-memory storage makes the tests go from about 1500s to about 600s.
* Keep the `pip` cache between jobs, to avoid re-downloading all the wheels all the time. This gains about 1min.

See merge request ae/Sith!279
This commit is contained in:
Skia 2021-09-30 10:58:49 +00:00
commit 7fd68e4825

View File

@ -4,19 +4,27 @@ stages:
test: test:
stage: test stage: test
script: script:
- env
- apt-get update - apt-get update
- apt-get install -y gettext python3-xapian libgraphviz-dev - apt-get install -y gettext python3-xapian libgraphviz-dev
- pushd /usr/lib/python3/dist-packages/xapian && ln -s _xapian* _xapian.so && popd - pushd /usr/lib/python3/dist-packages/xapian && ln -s _xapian* _xapian.so && popd
- export PYTHONPATH="/usr/lib/python3/dist-packages:$PYTHONPATH" - export PYTHONPATH="/usr/lib/python3/dist-packages:$PYTHONPATH"
- python -c 'import xapian' # Fail immediately if there is a problem with xapian - python -c 'import xapian' # Fail immediately if there is a problem with xapian
- pip install -r requirements.txt - pip install -U -r requirements.txt
- pip install coverage - pip install -U coverage
- mkdir -p /dev/shm/search_indexes
- ln -s /dev/shm/search_indexes sith/search_indexes
- ./manage.py compilemessages - ./manage.py compilemessages
- coverage run ./manage.py test - coverage run ./manage.py test
- coverage html - coverage html
- coverage report - coverage report
- cd doc - cd doc
- make html # Make documentation - make html # Make documentation
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_tests"
cache:
paths:
- .cache/pip_tests
artifacts: artifacts:
paths: paths:
- coverage_report/ - coverage_report/
@ -24,5 +32,10 @@ test:
black: black:
stage: test stage: test
script: script:
- pip install black - pip install -U black
- black --check . - black --check .
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip_black"
cache:
paths:
- .cache/pip_black