forked from shopware/SwagPayPal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
147 lines (140 loc) · 5.86 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
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: 'tcp://docker:2375'
MYSQL_ROOT_PASSWORD: app
WEB_DOCUMENT_ROOT: $CI_PROJECT_DIR/development/public
DEVELOPMENT_BRANCH: 'master'
PLATFORM_BRANCH: 'master'
CMS_EXTENSION_BRANCH: 'master'
RUN_IN_MR: 'true'
INSTALL_CMS: 'true'
stages:
- Static analysis
- Testing
default:
image: shopware/development:latest
before_script:
- zip -rq plugin.zip .
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/6/product/development.git --branch $DEVELOPMENT_BRANCH
- rm -rf development/platform
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/6/product/platform.git development/platform --branch $PLATFORM_BRANCH
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/6/services/cms-extensions.git development/custom/plugins/SwagCmsExtensions --branch $CMS_EXTENSION_BRANCH
- unzip -q plugin.zip -d development/custom/plugins/SwagPayPal
- cd development
- composer dump-autoload -d custom/plugins/SwagCmsExtensions
- cp -v dev-ops/gitlab/.psh.yaml.override .
- /entrypoint supervisord > /dev/null 2>&1 &
# Stage: Static analysis
Static analyze:
stage: Static analysis
services:
- name: mysql:5.7
alias: mysql
script:
- ./psh.phar init
- php bin/console plugin:install --activate SwagPayPal
- cd $CI_PROJECT_DIR/development/custom/plugins/SwagPayPal
- php ../../../dev-ops/analyze/vendor/bin/ecs check --config=../../../vendor/shopware/platform/easy-coding-standard.yml .
- php ../../../dev-ops/analyze/vendor/bin/ecs check --config=easy-coding-standard.yml
- bin/static-analyze.sh
- cd $CI_PROJECT_DIR/development
- ./psh.phar administration:init --APP_ENV="dev"
- cd $CI_PROJECT_DIR/development/custom/plugins/SwagPayPal
- ./../../../vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/.bin/eslint --ignore-path .eslintignore --config ../../../vendor/shopware/platform/src/Administration/Resources/app/administration/.eslintrc.js --ext .js,.vue .
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$RUN_IN_MR == "true" && $CI_PIPELINE_SOURCE == "merge_request_event"'
parallel:
matrix:
- PLATFORM_BRANCH: '6.3.0.0'
DEVELOPMENT_BRANCH: 'master'
- PLATFORM_BRANCH: '6.3.0.1'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: '6.3.0.2'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: '6.3.1.0'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: '6.3.1.1'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: 'master'
DEVELOPMENT_BRANCH: 'master'
ToDos resolved:
only:
refs:
- merge_requests
- master
stage: Static analysis
allow_failure: true
script:
- cd $CI_PROJECT_DIR/development/custom/plugins/SwagPayPal
- if [[ -n $CI_COMMIT_BRANCH ]]; then bin/check-todos.sh $CI_COMMIT_BRANCH; else bin/check-todos.sh $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME; fi
PHPUnit Coverage (6.3.x.x dev):
only:
refs:
- merge_requests
- master
stage: Testing
services:
- name: mariadb:10.3
alias: mysql
script:
- ./psh.phar init
- php bin/console plugin:install --activate SwagPayPal
- php bin/console plugin:install --activate SwagCmsExtensions
- composer dump-autoload -d custom/plugins/SwagPayPal
- ./psh.phar init-test-databases
- php -d pcov.enabled=1 -d pcov.directory=$CI_PROJECT_DIR
vendor/bin/phpunit
--configuration custom/plugins/SwagPayPal/phpunit.xml.dist
--log-junit build/artifacts/phpunit.junit.xml
--colors=never
--coverage-clover build/artifacts/phpunit.clover.xml
--coverage-html build/artifacts/phpunit-coverage-html
--coverage-text
coverage: '/^\s*Lines:\s*(\d+(?:\.\d+)?%)/'
artifacts:
paths:
- development/build/artifacts/phpunit.clover.xml
reports:
junit: development/build/artifacts/phpunit.junit.xml
PHPUnit:
stage: Testing
services:
- name: mysql:5.7
alias: mysql
script:
- ./psh.phar init
- php bin/console plugin:install --activate SwagPayPal
- if [[ $INSTALL_CMS = "true" ]]; then php bin/console plugin:install --activate SwagCmsExtensions; fi
- ./psh.phar init-test-databases
- cd $CI_PROJECT_DIR/development/custom/plugins/SwagPayPal
- bin/phpunit.sh
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$RUN_IN_MR == "true" && $CI_PIPELINE_SOURCE == "merge_request_event"'
parallel:
matrix:
- PLATFORM_BRANCH: '6.2'
DEVELOPMENT_BRANCH: '6.2'
INSTALL_CMS: 'false'
- PLATFORM_BRANCH: '6.3.0.0'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: '6.3.0.1'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: '6.3.0.2'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: '6.3.1.0'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: '6.3.1.1'
DEVELOPMENT_BRANCH: 'master'
RUN_IN_MR: 'false'
- PLATFORM_BRANCH: 'master'
DEVELOPMENT_BRANCH: 'master'