.gitlab-ci.yml 1.22 KB
Newer Older
Oliver Falk's avatar
Oliver Falk committed
1
image: docker.io/ofalk/fedora31-python3
Oliver Falk's avatar
Oliver Falk committed
2 3

before_script:
Oliver Falk's avatar
Oliver Falk committed
4
  - virtualenv -p python3 /tmp/.virtualenv
Oliver Falk's avatar
Oliver Falk committed
5
  - source /tmp/.virtualenv/bin/activate
6
  - pip install Pillow
Oliver Falk's avatar
Oliver Falk committed
7 8 9 10
  - pip install -r requirements.txt
  - pip install python-coveralls
  - pip install coverage
  - pip install pycco
Oliver Falk's avatar
Oliver Falk committed
11
  - pip install django_coverage_plugin
Oliver Falk's avatar
Oliver Falk committed
12 13 14 15

test_and_coverage:
  stage: test
  script:
Oliver Falk's avatar
Oliver Falk committed
16
    - echo 'from ivatar.settings import TEMPLATES' > config_local.py
Oliver Falk's avatar
Oliver Falk committed
17
    - echo 'TEMPLATES[0]["OPTIONS"]["debug"] = True' >> config_local.py
Oliver Falk's avatar
Oliver Falk committed
18
    - echo "DEBUG = True" >> config_local.py
Oliver Falk's avatar
Oliver Falk committed
19 20 21 22 23 24
    - python manage.py collectstatic --noinput
    - coverage run --source . manage.py test -v3
    - coverage report --fail-under=70
    - coverage html
  artifacts:
    paths:
Oliver Falk's avatar
Oliver Falk committed
25
      - htmlcov/
Oliver Falk's avatar
Oliver Falk committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

pycco:
  stage: test
  script:
    - /bin/true
    - find ivatar/ -type f -name "*.py"|grep -v __pycache__|grep -v __init__.py|grep -v /migrations/ | xargs pycco -p -d pycco -i -s
  artifacts:
    paths:
      - pycco/
    expire_in: 14 days

pages:
  before_script:
    - /bin/true
    - /bin/true
  stage: deploy
  dependencies:
    - test_and_coverage
    - pycco
  script:
Oliver Falk's avatar
Oliver Falk committed
46
    - mv htmlcov/ public/
Oliver Falk's avatar
Oliver Falk committed
47 48 49 50 51 52 53
    - mv pycco/ public/
  artifacts:
    paths:
      - public
    expire_in: 14 days
  only:
    - master