Try to speed up CI

This commit is contained in:
Anna Sidwell 2019-04-07 18:42:23 +01:00
parent 3b79d377ef
commit 11e8270185

View File

@ -9,6 +9,10 @@ services:
- mdillon/postgis:9.6-alpine
variables:
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
DEBUG: 1
POSTGRES_DB: ojusomap
@ -20,14 +24,24 @@ variables:
DATABASE_USER: $POSTGRES_USER
DATABASE_PASSWORD: $POSTGRES_PASSWORD
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- .cache/pip
before_script:
- apt-get update && cat system-requirements-debian.txt | xargs apt-get install -y
- python manage.py collectstatic
- python -V
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -U pip setuptools
- pip install -r requirements/base.txt
- pip install -r requirements/test.txt
pytest:
stage: test
before_script:
- pip install -U pip setuptools
- pip install -r requirements/base.txt
- pip install -r requirements/test.txt
- apt-get update && cat system-requirements-debian.txt | xargs apt-get install -y
- python manage.py collectstatic
script:
- pytest -v --cov=ojusomap --cov=apps