Commit 9c574b06 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Add doc-coverage target

parent 5635fd75
Pipeline #875 passed with stages
in 57 seconds
......@@ -5,6 +5,7 @@ from subprocess import check_output
from django.conf import settings
from django.db import models
from django.db.models.functions import Length
from django.template.loader import get_template
from django.utils.dateparse import parse_datetime
from django.utils.safestring import mark_safe
......@@ -274,6 +275,10 @@ class Project(Links, NamedModel, TimeStampedModel):
def registry(self):
return settings.PUBLIC_REGISTRY if self.public else settings.PRIVATE_REGISTRY
def doc_coverage_image(self):
images = Image.objects.filter(robotpkg__project=self, py3=False, target__name='16.04')
return images.order_by(Length('robotpkg__name').desc()).first()
class Repo(TimeStampedModel):
name = models.CharField(max_length=200)
......
......@@ -19,19 +19,29 @@ cache:
- make install
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
{% if project.tests %} - make check
{% endif %}{% if project.docs %} - make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
{% endif %}
{% for image in robotpkg.valid_images %}{{ image.get_job_name }}:
<<: *robotpkg-{{ robotpkg }}
image: {{ image.get_image_name }}
{% if image.debug %} before_script:
- echo PKG_OPTIONS.{{ robotpkg }}=debug >> /opt/openrobots/etc/robotpkg.conf
{% elif project.docs and image.target.name == '16.04' and not image.py3 %} artifacts:
{% endif %}
{% endfor %}{% endfor %}{% if project.tests or project.docs %}doc-coverage:
{% with image=project.doc_coverage_image %} <<: *robotpkg-{{ image.robotpkg }}
image: {{ image.get_image_name }}
before_script:
- echo -e 'CXXFLAGS+= --coverage\nLDFLAGS+= --coverage\nPKG_DEFAULT_OPTIONS= debug' >> /opt/openrobots/etc/robotpkg.conf
after_script:
- cd /root/robotpkg/{{ image.robotpkg.category }}/{{ image.robotpkg }}{% endwith %}
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
{% if project.docs %} - make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
{% endif %}{% if project.tests%} - mkdir -p ${CI_PROJECT_DIR}/coverage/
- gcovr -r .
- gcovr -r . --html --html-details -o ${CI_PROJECT_DIR}/coverage/index.html
{% endif %} artifacts:
expire_in: 1 day
paths:
- doxygen-html/
- coverage/
{% endif %}
{% endfor %}
{% endfor %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment