gitlab-ci.yml 2.45 KB
Newer Older
Guilhem Saurel's avatar
Guilhem Saurel committed
1
# https://rainboard.laas.fr/project/{{ project.slug }}/.gitlab-ci.yml
2

3
variables:
Guilhem Saurel's avatar
typo    
Guilhem Saurel committed
4
  CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
5
  CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
6
7
8

cache:
  paths:
9
    - ccache
10

Guilhem Saurel's avatar
Guilhem Saurel committed
11
{% for robotpkg in project.ordered_robotpkg %}.robotpkg-{{ robotpkg }}: &robotpkg-{{ robotpkg }}
Guilhem Saurel's avatar
Guilhem Saurel committed
12
  retry:
Guilhem Saurel's avatar
Guilhem Saurel committed
13
14
    max: 2
    when: runner_system_failure
15
16
  except:
    - gh-pages
17
  script:
18
    - mkdir -p ccache
19
    - cd /root/robotpkg/{{ robotpkg.category }}
20
    - git pull
21
{% if robotpkg.without_py %}    - cd {{ robotpkg.without_py }}
Guilhem Saurel's avatar
Guilhem Saurel committed
22
    - make checkout MASTER_REPOSITORY="git ${CI_PROJECT_DIR}/.git"
23
24
    - cd ..
{% endif %}    - cd {{ robotpkg }}
Guilhem Saurel's avatar
Guilhem Saurel committed
25
    - make checkout MASTER_REPOSITORY="git ${CI_PROJECT_DIR}/.git"
26
    - make install
Guilhem Saurel's avatar
Guilhem Saurel committed
27
    - build=$(make show-var VARNAME=CONFIGURE_DIRS); cd $(make show-var VARNAME=WRKSRC); cd $build
28
{% if project.tests %}    - make test
Guilhem Saurel's avatar
Guilhem Saurel committed
29
{% endif %}
30
{% for image in robotpkg.valid_images %}{{ image.get_job_name }}:
Guilhem Saurel's avatar
Guilhem Saurel committed
31
  <<: *robotpkg-{{ robotpkg }}
Guilhem Saurel's avatar
Guilhem Saurel committed
32
  image: {{ image.get_image_name }}
Guilhem Saurel's avatar
Guilhem Saurel committed
33
34
{% if image.allow_failure %}  allow_failure: true
{% endif %}{% if image.debug %}  before_script:
35
    - echo PKG_OPTIONS.{{ robotpkg }}=debug >> /opt/openrobots/etc/robotpkg.conf
Guilhem Saurel's avatar
Guilhem Saurel committed
36
37
38
39
40
41
42
43
{% 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 %}
Guilhem Saurel's avatar
Guilhem Saurel committed
44
    - build=$(make show-var VARNAME=CONFIGURE_DIRS); cd $(make show-var VARNAME=WRKSRC); cd $build
Guilhem Saurel's avatar
Guilhem Saurel committed
45
46
47
48
49
50
{% 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:
51
52
    expire_in: 1 day
    paths:
Guilhem Saurel's avatar
Guilhem Saurel committed
53
      - doxygen-html/
Guilhem Saurel's avatar
Guilhem Saurel committed
54
      - coverage/
Guilhem Saurel's avatar
Guilhem Saurel committed
55
56
{% endif %}
format:
Guilhem Saurel's avatar
Guilhem Saurel committed
57
{% if project.allow_format_failure %}  allow_failure: true
Guilhem Saurel's avatar
Guilhem Saurel committed
58
{% endif %}  image: gepetto/linters
Guilhem Saurel's avatar
Guilhem Saurel committed
59
60
61
  retry:
    max: 2
    when: runner_system_failure
Guilhem Saurel's avatar
Guilhem Saurel committed
62
63
64
  before_script:
    - test -f /builds/setup.cfg || ln -s /root/setup.cfg /builds
    - test -f /builds/.clang-format || ln -s /root/.clang-format /builds
Guilhem Saurel's avatar
Guilhem Saurel committed
65
66
  script:
    - check-clang-format.sh
Guilhem Saurel's avatar
Guilhem Saurel committed
67
    {% if project.has_python %}- flake8 .
Guilhem Saurel's avatar
yapf .    
Guilhem Saurel committed
68
    - yapf -dr .
Guilhem Saurel's avatar
Guilhem Saurel committed
69
{% endif %}