aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-08-30 21:23:35 +0200
committerGravatar Johannes Christ <[email protected]>2018-08-30 21:28:49 +0200
commitf7fadfd8e7800545ab89accf0f650f8d546d4350 (patch)
treeed2b451682b8407e2eee592522376742c5d7c40e /.gitlab-ci.yml
parentRemove no longer needed conditional. (diff)
Add coverage reports.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml30
1 files changed, 28 insertions, 2 deletions
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