-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
86 lines (81 loc) · 1.97 KB
/
.gitlab-ci.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
stages:
- compile
- test
# - deploy
compile:
stage: compile
image: composer:latest
script:
- composer install
artifacts:
when: always
paths:
- vendor/
- var/cache/
expire_in: 10 minutes
only:
- merge_requests
- master
tags:
- docker
code:analyse:
stage: test
image: php:latest
script:
- vendor/bin/phpstan analyse src -c tools/phpstan/fpm-config.neon
only:
- merge_requests
- master
tags:
- docker
needs:
- job: compile
artifacts: true
code:cs-fixer:
stage: test
image: php:latest
script:
- vendor/bin/php-cs-fixer fix --dry-run --diff -vvv
only:
- merge_requests
- master
tags:
- docker
needs:
- job: compile
artifacts: true
code:test:
stage: test
image: php:latest
before_script:
- pecl install xdebug
- docker-php-ext-enable xdebug
- echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
script:
- vendor/bin/phpunit --do-not-cache-result --log-junit var/coverage/phpunit-report.xml --coverage-cobertura var/coverage/phpunit-coverage.xml --coverage-text --colors=never
only:
- merge_requests
- master
tags:
- docker
needs:
- job: compile
artifacts: true
artifacts:
when: always
reports:
junit: var/coverage/phpunit-report.xml
coverage_report:
coverage_format: cobertura
path: var/coverage/phpunit-coverage.xml
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
# deploy:
# stage: deploy
# image: alpine
# script:
# - apk add curl
# - 'curl --header "Job-Token: $CI_JOB_TOKEN" --data tag=$CI_COMMIT_TAG "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/composer"'
# only:
# - tags
# tags:
# - docker