Select Git revision
-
Grzegorz Rola authoredGrzegorz Rola authored
unit.yml 2.39 KiB
.template: &job-test-template
tags:
- unit
stage: tests
except:
variables:
- $IS_NPM_LIBRARY
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
artifacts:
reports:
junit: tmp_artifacts/report.xml
interruptible: true
.template: &job-test-unit-template
<<: *job-test-template
before_script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
script:
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --coverage-text --colors=never --log-junit tmp_artifacts/report.xml
after_script:
- 'if [[ ${REPORTPORTAL_AUTHORIZATION} && ${REPORTPORTAL_PROJECT} ]]; then curl -X POST "http://195.201.225.204:8080/api/v1/${REPORTPORTAL_PROJECT}/launch/import" -H "accept: */*" -H "Content-Type: multipart/form-data" -H "${REPORTPORTAL_AUTHORIZATION}" -F "file=file=@tmp_artifacts/report.xml;type=text/xml;type=text/xml;filename=${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}-unit.xml"; fi'
only:
- master
- main
except:
variables:
- $DISABLE_COVERAGE
.template: &job-test-unit-template-fast
<<: *job-test-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- vendor/bin/phpunit -d memory_limit=-1 --configuration phpunit-unit.xml --no-coverage --log-junit tmp_artifacts/report.xml
unit test lastest:
<<: *job-test-unit-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
only:
refs:
- devel
- tags
except:
variables:
- $IS_NPM_LIBRARY
unit test lastest coverage:
<<: *job-test-unit-template
image: wpdesknet/phpunit-woocommerce:0-0
only:
refs:
- master
- main
unit test lastest manual:
<<: *job-test-unit-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
when: manual
allow_failure: true
except:
refs:
- master