ngyuki/clover-to-cobertura

Clover XML to Cobertura XML for Gitlab Coverage Visualization

v0.0.1 2020-12-18 06:12 UTC

This package is auto-updated.

Last update: 2022-01-18 08:43:27 UTC


README

Clover XML to Cobertura XML for Gitlab Coverage Visualization

Install

curl https://raw.githubusercontent.com/ngyuki/clover-to-cobertura/master/clover-to-cobertura.php \
  -o clover-to-cobertura.php

Or

composer require --dev ngyuki/clover-to-cobertura

Usage

php clover-to-cobertura.php < clover.xml > cobertura.xml

Example for Gitlab CI

# .gitlab-ci.yml

image: ngyuki/php-dev

stages:
  - test

test:
  stage: test
  only:
    - merge_requests
  script:
    - composer install --no-progress --ansi
    - phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml
    - test -e clover-to-cobertura.php ||
        curl https://raw.githubusercontent.com/ngyuki/clover-to-cobertura/master/clover-to-cobertura.php
            -o clover-to-cobertura.php
    - php clover-to-cobertura.php < clover.xml > cobertura.xml
  cache:
    paths:
      - vendor/
      - clover-to-cobertura.php
  artifacts:
    reports:
      cobertura: cobertura.xml

License