.gitlab-ci.yml 653 Bytes
Newer Older
okhin's avatar
okhin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"

cache:
    paths:
        - "$CI_PROJECT_DIR/pip-cache"
    key: "$CI_PROJECT_ID"

stages:
    - test
    - build
    - deploy

unit tests:
    stage: test
    script:
okhin's avatar
okhin committed
17
        - virtualenv -p python3 env
okhin's avatar
okhin committed
18 19 20 21 22 23
        - source ./env/bin/activate
        - pip install -r requirements.txt
        - pip install -r requirements-dev.txt
        - pip install -r requirements-tests.txt
        - echo "DEBUG = True" > ./project/settings/env.py
        - echo "SECRET_KEY = '$(pwgen 20 1)'" >> ./project/settings/env.py
24
        - ./manage.py migrate
okhin's avatar
okhin committed
25 26
        - pytest apps/ --cov=apps/
    tags: [preprod]