forked from viezel/GitLab-CI-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci-php-coverage-report.yml
49 lines (41 loc) · 1.14 KB
/
.gitlab-ci-php-coverage-report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#
# Gitlab CI configuration with PHP Code Coverage HTML report
# We merge multiple suits coverage reports and save those for download
#
stages:
- test
cache:
# cache per-job and per-branch
key: "$CI_BUILD_NAME/$CI_BUILD_REF_NAME"
paths:
- vendor/
before_script:
- apt-get update -yqq
# PHP Extensions
- docker-php-ext-enable zip mbstring pdo_mysql soap mysqli gd
# Install packages through composer
- composer self-update
- composer install --no-progress --no-interaction
# run your app install commands here
variables:
WITH_XDEBUG: "1"
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: myapp_testing
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
COMPOSER_HOME: /cache/composer
test:php7:full-report:
image: tetraweb/php:7.0
stage: test
artifacts:
paths:
- tests/_output/coverage
expire_in: 1 month
script:
- do_run() { vendor/bin/codecept run --coverage=$1.cov $1; };
- vendor/bin/codecept run acceptance
- do_run api
- do_run functional
- do_run unit
- vendor/bin/phpcov merge tests/_output --text=Coverage
- vendor/bin/phpcov merge tests/_output --html=tests/_output/coverage