forked from PAYONE-GmbH/shopware-6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
156 lines (146 loc) · 4.88 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
stages:
- style
- quality
- test
- package
- validate
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
variables:
DOCKER_DRIVER: overlay2
BASE_SW_VERSION: '6.4.0.0'
COMPOSER_COMMAND: "/var/www/html/composer install --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader"
include: '/.gitlab/ci-legacy.yml'
codestyle:
stage: style
image: "dockware/play:${BASE_SW_VERSION}"
needs: [ ]
except:
variables: [ $DISABLE_PHP_CS == "1" ]
before_script:
- curl https://getcomposer.org/download/1.10.19/composer.phar -o /var/www/html/composer
- chmod +x /var/www/html/composer
- /var/www/html/composer self-update --2
- ${COMPOSER_COMMAND}
- cp -r ${CI_PROJECT_DIR} /var/www/html/custom/plugins/${CI_PROJECT_NAME}
script:
- cd /var/www/html/custom/plugins/${CI_PROJECT_NAME} && vendor/bin/php-cs-fixer fix -v --dry-run
cache:
key: global
paths:
- .php_cs.cache
- vendor
k10r-phpstan:
stage: quality
image: "dockware/play:${SW_VERSION}"
parallel:
matrix:
- PHP_VERSION: [ "7.4" ]
SW_VERSION: [ "6.4.0.0", "6.4.1.0", "6.4.2.1", "6.4.3.0" ]
needs: [ ]
except:
variables: [ $DISABLE_PHPSTAN_K10R == "1" ]
before_script:
- curl https://getcomposer.org/download/1.10.19/composer.phar -o /var/www/html/composer
- chmod +x /var/www/html/composer
- /var/www/html/composer self-update --2
- ${COMPOSER_COMMAND}
- cp -r ${CI_PROJECT_DIR} /var/www/html/custom/plugins/${CI_PROJECT_NAME}
script:
- cd /var/www/html/custom/plugins/${CI_PROJECT_NAME} && vendor/bin/phpstan analyse -c phpstan.neon -a vendor/autoload.php -a ../../../vendor/autoload.php src tests
cache:
key: global
paths:
- vendor
sw-phpstan:
stage: quality
image: "dockware/play:${SW_VERSION}"
parallel:
matrix:
- PHP_VERSION: [ "7.4" ]
SW_VERSION: [ "6.4.0.0", "6.4.1.0", "6.4.2.1", "6.4.3.0" ]
needs: [ ]
except:
variables: [ $DISABLE_PHPSTAN_SW == "1" ]
before_script:
- curl https://getcomposer.org/download/1.10.19/composer.phar -o /var/www/html/composer
- chmod +x /var/www/html/composer
- if [ $SW_VERSION == '6.4.0.0' ]; then /var/www/html/composer self-update --2; else /var/www/html/composer self-update --2; fi
- ${COMPOSER_COMMAND}
- cp -r ${CI_PROJECT_DIR} /var/www/html/custom/plugins/${CI_PROJECT_NAME}
- cd /tmp && git clone https://github.com/shopwareLabs/store-plugin-codereview.git
- cp -r /tmp/store-plugin-codereview/configs/phpstan/phpstan.neon.sw6 /var/www/html/custom/plugins/${CI_PROJECT_NAME}/phpstan_sw.neon
script:
- cd /var/www/html/custom/plugins/${CI_PROJECT_NAME} && vendor/bin/phpstan analyse -c phpstan_sw.neon -a vendor/autoload.php -a ../../../vendor/autoload.php src tests
cache:
key: global
paths:
- vendor
phpunit:
stage: test
image: "dockware/play:${SW_VERSION}"
parallel:
matrix:
- PHP_VERSION: [ "7.4" ]
SW_VERSION: [ "6.4.0.0", "6.4.1.0", "6.4.2.1", "6.4.3.0" ]
needs: [ ]
except:
variables: [ $DISABLE_PHPUNIT == "1" ]
before_script:
- curl https://getcomposer.org/download/1.10.19/composer.phar -o /var/www/html/composer
- chmod +x /var/www/html/composer
- /var/www/html/composer self-update --2
- ${COMPOSER_COMMAND}
- cp -r ${CI_PROJECT_DIR} /var/www/html/custom/plugins/${CI_PROJECT_NAME}
- sudo rm -rf /var/run/mysqld/mysqld.sock.lock
- sudo chown -R mysql:mysql /var/lib/mysql /var/run/mysqld
- sudo service mysql start
- cd /var/www/html/ && rm -rf vendor && ${COMPOSER_COMMAND} --no-scripts
script:
- cd /var/www/html/ && php bin/console plugin:refresh -nq && php bin/console plugin:install --activate -c PayonePayment -nq
- cd /var/www/html/ && /var/www/html/composer dump-autoload -d custom/plugins/${CI_PROJECT_NAME}
- cd /var/www/html/ && php -d pcov.enabled=1 -d pcov.directory=/var/www/html/
vendor/bin/phpunit
--configuration custom/plugins/${CI_PROJECT_NAME}/phpunit-dockware.xml.dist
cache:
key: global
paths:
- vendor
package:
stage: package
image:
name: ghcr.io/friendsofshopware/platform-plugin-dev:v6.3.1
entrypoint: [ "" ]
only:
- tags
- master
- develop
- /^integration.*$/
- /^fix.*$/
except:
variables: [ $DISABLE_PACKAGE == "1" ]
script:
- start-mysql
- ln -s "$(pwd)" "/plugins/PayonePayment"
- plugin-uploader ext:prepare "/plugins/PayonePayment"
- rm -rf $( cat .sw-zip-blocklist ) && rm -rf .sw-zip-blocklist
- pack-plugin PayonePayment
artifacts:
paths:
- "*.zip"
shopware-validate:
stage: validate
image:
name: friendsofshopware/plugin-uploader:0.3.5
entrypoint: [ "/bin/sh", "-c" ]
needs:
- package
only:
- tags
- master
- /^integration.*$/
- /^fix.*$/
except:
variables: [ $DISABLE_VALIDATION == "1" ]
script:
- php /app/bin/pluginupload ext:validate ${CI_PROJECT_NAME}.zip