From f7fadfd8e7800545ab89accf0f650f8d546d4350 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Thu, 30 Aug 2018 21:23:35 +0200 Subject: Add coverage reports. --- .gitlab-ci.yml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b413115..cec84074 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ stages: - build - lint - test + - deploy build base image: image: docker:stable-git @@ -26,11 +27,36 @@ test: stage: test services: - postgres:10-alpine - script: + before_script: - python manage.py migrate - - python manage.py test + - pip install coverage + script: + - coverage run --source=api,home,pysite,wiki --branch manage.py test + after_script: + - coverage report + artifacts: + paths: + - .coverage variables: DATABASE_URL: postgres://django:supersecret@postgres/pysite POSTGRES_DB: pysite POSTGRES_PASSWORD: supersecret POSTGRES_USER: django + +pages: + stage: deploy + image: + dependencies: + - test + before_script: + - pip install coverage + script: + - coverage html --directory=public + artifacts: + paths: + - public + expire_in: 30 days + only: + - master + - django + - django+add-gitlab-ci -- cgit v1.2.3