summaryrefslogblamecommitdiff
path: root/.gitlab-ci.yml
blob: 3953d372921cbde653b70e0fa56f9fd113e8c935 (plain) (tree)
1
2
3
4
5
6
7
8

               





             




               
                                                                               



            




             
                                                                                                                                                
            
          
           



                            
         
             





                                                     



               


                                                                                                         


                                 
                    
            
                          




               
            

                
                                     




                                               
                            




            
image: ruby:2.5

stages:
  - build
  - test
  - late-test
  - deploy

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

test:
  stage: test
  script:
  - cd tests
  - PATH=../build/tools/hscript-validate:../build/tools/hscript-simulate:../build/owner:$PATH rspec --format RspecJunitFormatter --out rspec.xml
  artifacts:
    paths:
    - build
    - tests/rspec.xml
    reports:
      junit: tests/rspec.xml

valgrind:
  stage: test
  script:
  - cd build
  - CTEST_OUTPUT_ON_FAILURE=TRUE ctest -R 'Valgrind*'

coverage:
  stage: late-test
  dependencies:
  - test
  script:
  - cd build
  - make lcov_report
  - make lcov_html
  - printf 'coverage %s\n' $(lcov --summary horizon.coverage | grep lines | cut -d ' ' -f4) > metrics.txt
  coverage: '/lines.+: \d+.\d+%/'
  artifacts:
    paths:
    - build/cov_html
    reports:
      metrics: metrics.txt

pages:
  stage: deploy
  dependencies:
  - test
  - coverage
  script:
  - mkdir public
  - mv build/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