-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
77 lines (69 loc) · 1.87 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
image: edbizarro/gitlab-ci-pipeline-php:7.2
stages:
- building
- testing
- security
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
composer:
stage: building
script:
- php -v
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
artifacts:
paths:
- composer.lock
- vendor/
expire_in: 1 days
when: always
cache:
paths:
- vendor/
phpunit:
stage: testing
dependencies:
- composer
script:
- sudo cp /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.bak
- echo "" | sudo tee /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- ./vendor/phpunit/phpunit/phpunit --version
- php -d short_open_tag=off ./vendor/phpunit/phpunit/phpunit -v --colors=never --stderr
- sudo cp /usr/local/etc/php/conf.d/docker-php-ext-xdebug.bak /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
codestyle:
stage: testing
script:
- test -f phpcs.phar || curl -L https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -o phpcs.phar
- php phpcs.phar --extensions=php --standard=PSR2 src
dependencies: []
cache:
paths:
- phpcs.phar
psalm:
stage: testing
dependencies:
- composer
script:
- cp psalm.xml.dist psalm.xml
- ./vendor/vimeo/psalm/psalm --version
- ./vendor/vimeo/psalm/psalm
phpcpd:
stage: testing
dependencies: []
script:
- test -f phpcpd.phar || curl -L https://phar.phpunit.de/phpcpd.phar -o phpcpd.phar
- php phpcpd.phar src/ --min-lines=50
cache:
paths:
- phpcpd.phar
sensiolabs:
stage: security
dependencies:
- composer
script:
- test -d security-checker || git clone https://github.com/sensiolabs/security-checker.git
- cd security-checker
- composer install
- php security-checker security:check ../composer.lock
cache:
paths:
- security-checker/