-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
130 lines (115 loc) · 3.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
121
122
123
124
125
126
127
128
129
130
stages:
- basic
- fullinstall
# PHP 7.0 simple linting
php-7.0-linting:
stage: basic
image: php:7.0
script:
- sh -c 'if find . -name "*.php" -exec php -l {} 2>&1 \; | grep -v "^No syntax errors detected"; then exit 1; fi'
# PHP 7.1 simple linting
php-7.1-linting:
stage: basic
image: php:7.1
script:
- sh -c 'if find . -name "*.php" -exec php -l {} 2>&1 \; | grep -v "^No syntax errors detected"; then exit 1; fi'
# PHP 7.2 simple linting
php-7.2-linting:
stage: basic
image: php:7.2
script:
- sh -c 'if find . -name "*.php" -exec php -l {} 2>&1 \; | grep -v "^No syntax errors detected"; then exit 1; fi'
# PHP 7.2 codesniffing
php-7.2-phpcs:
stage: basic
image: yireo/php-testbox:7.2
script:
- phpcs --colors --standard=PSR2 --report=full --extensions=php,phtml .
- composer validate
# Magento MEQP2 validation
magento-eqp2-basic:
stage: basic
image: yireo/php-testbox:7.1
script:
- composer create-project --repository=https://repo.magento.com magento/marketplace-eqp /tmp/meqp2
- php /tmp/meqp2/vendor/bin/phpcs . --standard=MEQP2 --severity=10 --extensions=php,phtml
# Magento 2.1 testing
magento-2.1-validation:
stage: fullinstall
image: yireo/magento2ci:7.0
script:
- source .gitlab-ci.env && test "$RUN_MAGENTO_21" -eq "0" && exit 0
- git clone https://gitlab.yireo.com/tools/magento2devbox.git /tmp/magento2devbox &&
/tmp/magento2devbox/magento/scripts/install-magento.sh &&
/tmp/magento2devbox/magento/scripts/gitlab-ci.sh
variables:
MAGENTO_VERSION: "2.1.12"
MAGENTO_ADD_REDIS: "0"
RUN_PHPUNIT_UNIT_TESTS: "0"
RUN_PHPUNIT_INTEGRATION_TESTS: "0"
RUN_YIREO_EXTENSIONCHECKER: "0"
services:
- name: mysql:5.7
# Magento 2.2 testing
magento-2.2-validation:
image: yireo/magento2ci:7.1
stage: fullinstall
script:
- source .gitlab-ci.env && test "$RUN_MAGENTO_22" -eq "0" && exit 0
- git clone https://gitlab.yireo.com/tools/magento2devbox.git /tmp/magento2devbox &&
/tmp/magento2devbox/magento/scripts/install-magento.sh &&
/tmp/magento2devbox/magento/scripts/gitlab-ci.sh
variables:
MAGENTO_VERSION: "2.2.7"
services:
- name: mysql:5.7
- name: redis
# Magento 2.3 testing
magento-2.3-validation:
image: yireo/magento2ci:7.2
stage: fullinstall
script:
- source .gitlab-ci.env && test "$RUN_MAGENTO_23" -eq "0" && exit 0
- git clone https://gitlab.yireo.com/tools/magento2devbox.git /tmp/magento2devbox &&
/tmp/magento2devbox/magento/scripts/install-magento.sh &&
/tmp/magento2devbox/magento/scripts/gitlab-ci.sh
variables:
MAGENTO_VERSION: "2.3.0"
services:
- name: mysql:5.7
- name: redis
# Global variables
variables:
# Composer handies
COMPOSER_CACHE_DIR: "/build/cache"
COMPOSER_ALLOW_SUPERUSER: "1"
# Custom webfolder
WEB_DIR: "/magento"
DOCKER_DRIVER: overlay2
# Magento runs
RUN_MAGENTO_21: "1"
RUN_MAGENTO_22: "1"
RUN_MAGENTO_23: "1"
# Simple flags to speed up deployment
MAGENTO_ADD_SAMPLE_DATA: "0"
MAGENTO_ADD_CRON: "0"
MAGENTO_REMOVE_3PO: "0"
DB_DUMP: "0"
# MySQL variables, also needed by the MySQL service
MYSQL_HOST: "mysql"
MYSQL_USER: "magento2"
MYSQL_PASSWORD: "magento2"
MYSQL_DATABASE: "magento2"
MYSQL_ROOT_PASSWORD: "root"
MYSQL_SQL_TO_RUN: 'GRANT ALL ON *.* TO "magento2"@"%";'
# CI purpose
RUN_PHPCS_EQP2: "1"
RUN_PHPCS_EXTDN: "1"
RUN_YIREO_EXTENSIONCHECKER: "1"
RUN_PHPUNIT_UNIT_TESTS: "1"
RUN_PHPUNIT_INTEGRATION_TESTS: "1"
cache:
key: "$CI_JOB_NAME"
paths:
- /build/cache/
- vendor/