-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
167 lines (154 loc) · 3.96 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
stages:
- build
- test
- dast
include:
- template: Container-Scanning.gitlab-ci.yml
- template: DAST.gitlab-ci.yml
- template: Dependency-Scanning.gitlab-ci.yml
- template: License-Management.gitlab-ci.yml
- template: SAST.gitlab-ci.yml
#--------------------------------------------------------------------------------
# 0: Build
#--------------------------------------------------------------------------------
buildComposerDeps:
image: docker.kay-strobach.de/docker/php:7.2
stage: build
variables:
COMPOSER_CACHE_DIR: '.composer'
before_script:
- php -v
script:
- composer install --prefer-dist --no-progress --optimize-autoloader --no-dev
tags:
- docker
artifacts:
when: on_success
expire_in: 2 weeks
paths:
- Configuration/PackageStates.php
- Packages
- Web
- Build
- bin
cache:
paths:
- .composer
#--------------------------------------------------------------------------------
# 1: Stage test
#--------------------------------------------------------------------------------
phplint:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
before_script:
- php -v
script:
- parallel-lint Classes --exclude "vendor"
tags:
- docker
phpCPD:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
before_script:
- php -v
script:
- phpcpd Classes
tags:
- docker
allow_failure: true
phpCS:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
script:
- phpcs --standard=PSR2 --colors $PHP_CS_FILTER --report=junit > junit.phpcs.xml || true
artifacts:
reports:
junit: "junit.phpcs.xml"
tags:
- docker
phpMd:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
script:
- phpmd Classes text codesize,unusedcode,design,cleancode,controversial --ignore-violations-on-exit --suffixes php
tags:
- docker
allow_failure: true
phploc:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
script:
- phploc --count-tests .
tags:
- docker
.phpUnit/php-7.1:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
script:
- composer install
- bin/phpunit --colors -c Build/PhpUnit/UnitTests.xml --log-junit junit.php71.xml
artifacts:
reports:
junit: "junit.php71.xml"
tags:
- docker
allow_failure: true
.phpUnit/php-7.2:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
script:
- composer install
- bin/phpunit --colors -c Build/PhpUnit/UnitTests.xml --log-junit junit.php72.xml
artifacts:
reports:
junit: "junit.php72.xml"
tags:
- docker
allow_failure: true
.phpUnit/php-7.2-coverage-complete:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
before_script:
- pecl channel-update pecl.php.net
- pecl install xdebug
- docker-php-ext-enable xdebug
script:
- composer install
- bin/phpunit --coverage-text --colors=never -c Build/PhpUnit/UnitTests.xml
tags:
- docker
allow_failure: true
securityTest:
image: docker.kay-strobach.de/docker/php:7.2
stage: test
script:
- composer install
- bin/security-checker security:check
tags:
- docker
allow_failure: true
.stylelint:
image: docker.kay-strobach.de/docker/stylelint:latest
stage: test
script:
- stylelint "Resources/Public/Stylesheets/*.css"
tags:
- docker
checkDeprecations:
image: docker.kay-strobach.de/docker/php:7.1
stage: test
variables:
SCANNER_RELEASE: "https://github.com/Tuurlijk/typo3scan/releases/download/1.6.2/typo3scan.phar"
script:
- curl -L $SCANNER_RELEASE --output typo3scan.phar
- php ./typo3scan.phar
- mkdir -p Build/Report/Deprecations
- for d in web/typo3conf/ext/*/ ; do (php ./typo3scan.phar scan --target 9 --format markdown $d > Build/Report/Deprecations/v9-$(basename $d).md); done
- php ./typo3scan.phar scan --target 8 --format junit web/typo3conf/ext/ > Build/Report/Deprecations/junit.xml
artifacts:
reports:
junit: Build/Report/Deprecations/junit.xml
when: on_success
expire_in: 7 days
paths:
- Build