User Tools

Site Tools


gitlab-ci-phpunit

This is an old revision of the document!


Gitlab PHPUnit

Generate junit reports in PHPUnit and upload it as Artifact to Gitlab reports.

phpunit:
  image: php:7.4 # A PHP Image with xDebug enabled
  stage: test
  # Upload Artifact so Gitlab can display Test in Job -> Tests tab
  artifacts:
    when: always
    paths:
      - phpunit-report.xml
    reports:
      junit: phpunit-report.xml
  script:
    - ./vendor/bin/phpunit --coverage-text --log-junit phpunit-report.xml
gitlab-ci-phpunit.1617088455.txt.gz · Last modified: 2021/03/30 09:14 by admin