forked from shopware5/SwagImportExport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
120 lines (112 loc) · 4.51 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
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: "tcp://docker:2375"
DOCKER_TLS_CERTDIR: "/certs"
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: app
MYSQL_PASSWORD: app
MYSQL_DATABASE: shopware
WEB_DOCUMENT_ROOT: $CI_PROJECT_DIR/
GIT_STRATEGY: clone
SHOPWARE_ENV: swagimportexporttest
CHECKOUT_SHOPWARE_BRANCH: "5.6"
stages:
- Code Style Check
- PHPUnit
default:
image: shopware/5-continuous:7.3
before_script:
- zip -rq plugin.zip .
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/5/product/shopware.git shopware --depth=1 -b ${CHECKOUT_SHOPWARE_BRANCH}
- unzip -q plugin.zip -d shopware/engine/Shopware/Plugins/Local/Backend/SwagImportExport
- cd shopware
- ./psh.phar init --SW_HOST="localhost"
- cp -r engine/Shopware/Plugins/Local/Backend/SwagImportExport/Tests/config_gitlab.php config.php
- php bin/console sw:plugin:refresh
- php bin/console sw:plugin:list
- php bin/console sw:plugin:install --activate SwagImportExport
- php bin/console sw:cache:clear
- /entrypoint supervisord &>/dev/null &
PHP analyze:
stage: Code Style Check
before_script: []
script:
- zip -rq plugin.zip .
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/5/product/shopware.git shopware --depth=1 -b ${CHECKOUT_SHOPWARE_BRANCH}
- unzip -q plugin.zip -d shopware/engine/Shopware/Plugins/Local/Backend/SwagImportExport
- cd shopware
- composer install
- vendor/bin/php-cs-fixer fix --dry-run -v --config=engine/Shopware/Plugins/Local/Backend/SwagImportExport/.php_cs.dist --format=junit | tee php-cs-fixer.xml
artifacts:
reports:
junit: shopware/php-cs-fixer.xml
Code Coverage:
stage: PHPUnit
needs: [PHP analyze]
script:
- composer req --dev phpunit/phpunit:~8.0 --update-with-all-dependencies
- cd engine/Shopware/Plugins/Local/Backend/SwagImportExport
- php -d pcov.enabled=1 -d pcov.directory=$CI_PROJECT_DIR
../../../../../../vendor/bin/phpunit
--configuration phpunit.xml.dist
--log-junit build/artifacts/phpunit.junit.xml
--colors=never
--coverage-text=build/artifacts/phpunit-coverage-text
- cat build/artifacts/phpunit-coverage-text | sed -e '/\\Shopware\\.*/d' -e '/\s*Methods:\s*\d*/d'
coverage: '/^\s*Lines:\s*(\d+(?:\.\d+)?%)/'
services:
- name: mysql:5.7
alias: mysql
artifacts:
paths:
- shopware/engine/Shopware/Plugins/Local/Backend/SwagImportExport/build/artifacts/*
reports:
junit: shopware/engine/Shopware/Plugins/Local/Backend/SwagImportExport/build/artifacts/phpunit.junit.xml
SW 5.6:
stage: PHPUnit
needs: [PHP analyze]
image: shopware/5-continuous:7.2
only:
- master
variables:
CHECKOUT_SHOPWARE_BRANCH: "5.6"
script:
- cd engine/Shopware/Plugins/Local/Backend/SwagImportExport
- php ../../../../../../vendor/bin/phpunit
--configuration phpunit.xml.dist
--colors=never
services:
- name: mysql:5.7
alias: mysql
.SW 5.7 default:
stage: PHPUnit
needs: [PHP analyze]
services:
- name: mysql:5.7
alias: mysql
variables:
CHECKOUT_SHOPWARE_BRANCH: "5.7"
before_script: []
script:
- zip -rq plugin.zip .
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/5/product/shopware.git shopware --depth=1 -b ${CHECKOUT_SHOPWARE_BRANCH}
- unzip -q plugin.zip -d shopware/engine/Shopware/Plugins/Local/Backend/SwagImportExport
- cd shopware
- cp .env.dist .env
- make init
- cp -r engine/Shopware/Plugins/Local/Backend/SwagImportExport/Tests/config_gitlab_5.7.php config.php
- php bin/console sw:plugin:refresh
- php bin/console sw:plugin:list
- php bin/console sw:plugin:install --activate SwagImportExport
- php bin/console sw:cache:clear
- /entrypoint supervisord &>/dev/null &
- cd engine/Shopware/Plugins/Local/Backend/SwagImportExport
- php ../../../../../../vendor/bin/phpunit
--configuration phpunit.xml.dist
--colors=never
SW 5.7 PHP 7.3:
extends: .SW 5.7 default
image: shopware/5-continuous:7.3
SW 5.7 PHP 8.0:
extends: .SW 5.7 default
image: gitlab.shopware.com:5005/shopware/5/product/image/continuous:8.0