summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: bdab08c55716d993d15b8ec791803fe8ec1e6ec9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
image: ruby:2.5

build:
  stage: build
  script:
  - mkdir build
  - cd build
  - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON -DVALGRIND=ON
  - make -j4
  artifacts:
    paths:
    - build

test:
  stage: test
  script:
  - cd tests
  - PATH=../build/tools/hscript-validate:$PATH rspec --format RspecJunitFormatter --out rspec-validator.xml spec/validator.rb
  - PATH=../build/tools/hscript-simulate:$PATH rspec --format RspecJunitFormatter --out rspec-simulator.xml spec/simulator.rb
  - cd ..
  - lcov --exclude '/usr/include/c++/*' --exclude '*/3rdparty/*' --capture --directory build --output-file coverage.info
  - genhtml coverage.info --output-directory cov_html
  - printf 'coverage %s\n' $(lcov --summary coverage.info | grep lines | cut -d ' ' -f4) > metrics.txt
  coverage: '/lines.+: \d+.\d+%/'
  artifacts:
    paths:
    - cov_html
    reports:
      junit: tests/rspec-*.xml
      metrics: metrics.txt

valgrind:
  stage: test
  script:
  - CTEST_OUTPUT_ON_FAILURE=TRUE ctest -L Valgrind

pages:
  stage: deploy
  dependencies:
  - test
  script:
  - mkdir public
  - mv cov_html public/coverage
  - cd devel
  - make
  - mv requirements/html ../public/requirements
  - mv script/html ../public/script
  - mv vision/html ../public/vision
  - cp index.html ../public/
  artifacts:
    paths:
    - public
  only:
  - master