-
Notifications
You must be signed in to change notification settings - Fork 35
/
.gitlab-ci.yml
110 lines (104 loc) · 4.31 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
variables:
PLATFORM_MIN_VERSION: '6.6.0.0'
PLATFORM_DEFAULT_VERSION: 'trunk'
PLATFORM_BRANCH: $PLATFORM_DEFAULT_VERSION
CMS_EXTENSION_BRANCH: 'master'
COMMERCIAL_ENABLED: 'true'
DEPENDENCIES_WITHOUT_COMMERCIAL: |
[{ "name": "SwagCmsExtensions", "url": "gitlab.shopware.com/shopware/6/services/cms-extensions", "branch": "$CMS_EXTENSION_BRANCH" }]
DEPENDENCIES_WITH_COMMERCIAL: |
[
{ "name": "SwagCmsExtensions", "url": "gitlab.shopware.com/shopware/6/services/cms-extensions", "branch": "$CMS_EXTENSION_BRANCH" },
{ "name": "SwagCommercial", "url": "gitlab.shopware.com/shopware/6/product/commercial.git", "branch": "$PLATFORM_BRANCH" }
]
PLUGIN_DEPENDENCIES: $DEPENDENCIES_WITH_COMMERCIAL
phpunit:
services:
- name: $MYSQL_IMAGE
alias: database
entrypoint: [ 'sh', '-c', "docker-entrypoint.sh $MYSQL_CMD" ]
- name: redis
alias: redis
variables:
REDIS_URL: redis://redis:6379
script:
- composer dump-autoload --dev -d "${PROJECT_ROOT}/custom/plugins/${PLUGIN_NAME}"
- php
-d pcov.enabled=1 -d pcov.directory=$PWD/src -d pcov.exclude='~(vendor|tests|node_modules)~'
${PROJECT_ROOT}/vendor/bin/phpunit
--configuration phpunit.xml.dist
--log-junit ${CI_PROJECT_DIR}/phpunit.junit.xml
--colors=never
--coverage-cobertura ${CI_PROJECT_DIR}/cobertura.xml
--coverage-text | grep -v -E '^Shopware\\|^ Methods:' # do not output covered files lines
parallel:
matrix:
- MYSQL_IMAGE:
- mysql:8.0
DEV_IMAGE: [ 'shopware/development:8.2-composer-2', 'shopware/development:8.3-composer-2' ]
MYSQL_CMD: $MYSQL8_CMD
PLATFORM_BRANCH: [ $PLATFORM_MIN_VERSION, $PLATFORM_DEFAULT_VERSION ]
PLUGIN_DEPENDENCIES: [ $DEPENDENCIES_WITH_COMMERCIAL, $DEPENDENCIES_WITHOUT_COMMERCIAL ]
- MYSQL_IMAGE:
- mariadb:10.11
DEV_IMAGE: [ 'shopware/development:8.2-composer-2', 'shopware/development:8.3-composer-2' ]
PLATFORM_BRANCH: [ $PLATFORM_MIN_VERSION, $PLATFORM_DEFAULT_VERSION ]
PLUGIN_DEPENDENCIES: [ $DEPENDENCIES_WITH_COMMERCIAL, $DEPENDENCIES_WITHOUT_COMMERCIAL ]
validate openapi typescript:
stage: build
needs: []
rules:
- changes:
- 'src/**/*'
script:
- $CI_PROJECT_DIR/bin/console bundle:dump
- composer init:admin
- composer openapi:generate
- git update-index --refresh || printf ''
- git diff-index "${CI_COMMIT_SHA}" --quiet -- src/Resources/app/administration/src/types/openapi.d.ts || (echo "Please run 'composer openapi:generate' to update openapi.d.ts" && exit 1)
phpstan:
script:
- composer dump-autoload --dev -d "${PROJECT_ROOT}/custom/plugins/SwagCmsExtensions"
- "sed -i 's|reportUnmatchedIgnoredErrors: true|reportUnmatchedIgnoredErrors: false|' ./phpstan.neon.dist"
- - >
if [[ $PLATFORM_BRANCH == $PLATFORM_MIN_VERSION ]]; then
sed -i '/type_perfect/d' ./phpstan.neon.dist
sed -i '/narrow_return: true/d' ./phpstan.neon.dist
sed -i '/no_mixed: true/d' ./phpstan.neon.dist
sed -i '/null_over_false: true/d' ./phpstan.neon.dist
fi
- composer phpstan
parallel:
matrix:
- PLATFORM_BRANCH: [ $PLATFORM_MIN_VERSION, $PLATFORM_DEFAULT_VERSION ]
eslint (administration):
stage: test
needs: []
rules:
- changes:
- 'src/Resources/app/administration/**/*'
variables:
ADMIN_PATH: $CI_PROJECT_DIR/src/Administration/Resources/app/administration
script:
- $CI_PROJECT_DIR/bin/console bundle:dump
- npm ci --prefix $CI_PROJECT_DIR/src/Administration/Resources/app/administration --no-audit --prefer-offline
- composer -d $CI_PROJECT_DIR admin:generate-entity-schema-types # for all ts types
- composer init:admin
- composer lint:admin:ci
eslint (storefront):
stage: test
needs: []
rules:
- changes:
- 'src/Resources/app/storefront/**/*'
variables:
STOREFRONT_PATH: $CI_PROJECT_DIR/src/Storefront/Resources/app/storefront
script:
- $CI_PROJECT_DIR/bin/console bundle:dump
- npm ci --prefix $CI_PROJECT_DIR/src/Storefront/Resources/app/storefront --no-audit --prefer-offline
- composer init:storefront
- composer lint:storefront:ci
include:
project: 'shopware/6/product/platform'
ref: 'trunk'
file: '.gitlab/templates/plugin.yml'