Skip to content
Snippets Groups Projects
coverage.gitlab-ci.yml 1.04 KiB
Newer Older
Olivier BICHLER's avatar
Olivier BICHLER committed
coverage:ubuntu_cpp:
  stage: coverage
  needs: ["build:ubuntu_cpp"]
Olivier BICHLER's avatar
Olivier BICHLER committed
  tags:
    - docker
  script:
    - cd build_cpp
    - ctest --output-on-failure
Olivier BICHLER's avatar
Olivier BICHLER committed
    - gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR} --filter '\.\./include/' --filter '\.\./src/'
  coverage: /^\s*lines:\s*\d+.\d+\%/
  artifacts:
    name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
    expire_in: 2 days
    reports:
      coverage_report:
        coverage_format: cobertura
        path: build_cpp/coverage.xml

coverage:ubuntu_python:
  stage: coverage
  needs: ["build:ubuntu_python"]
Olivier BICHLER's avatar
Olivier BICHLER committed
  tags:
    - docker
  script:
    - pip install numpy coverage
    - source venv/bin/activate
    - cd aidge_core
    - python3 -m coverage run --source=. -m unittest discover -s unit_tests/ -v -b
    - python3 -m coverage report
    - python3 -m coverage xml
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml