-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
94 lines (82 loc) · 2.6 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
stages:
- basic
- fullinstall
# PHP 7.4 simple linting
php-7.4-linting:
stage: basic
image: php:7.4
script:
- sh -c 'if find . -name "*.php" -exec php -l {} 2>&1 \; | grep -v "^No syntax errors detected"; then exit 1; fi'
# PHP 7.3 simple linting
php-7.3-linting:
stage: basic
image: php:7.3
script:
- sh -c 'if find . -name "*.php" -exec php -l {} 2>&1 \; | grep -v "^No syntax errors detected"; then exit 1; fi'
# PHP 7.3 codesniffing
php-7.3-phpcs:
stage: basic
image: yireo/php-testbox:7.3
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.3
script:
- mkdir -p /tmp/magento-phpcs && cd /tmp/magento-phpcs && COMPOSER_MEMORY_LIMIT=-1 composer require --dev magento/magento-coding-standard
- php /tmp/magento-phpcs/vendor/bin/phpcs --config-set installed_paths vendor/magento/magento-coding-standard/
- php /tmp/magento-phpcs/vendor/bin/phpcs $CI_PROJECT_DIR --standard=Magento2 --severity=10 --extensions=php,phtml -s
# Magento 2.4 testing
magento-2.4-validation:
image: yireo/magento2base:7.4
stage: fullinstall
script:
- git clone https://gitlab.yireo.com/tools/docker-magento2-testbox.git /tmp/magento2devbox &&
/tmp/magento2devbox/magento/scripts/install-magento.sh &&
/tmp/magento2devbox/magento/scripts/gitlab-ci.sh
variables:
MAGENTO_VERSION: "2.4.2"
COMPOSER_VERSION: "2"
services:
- name: mysql:5.7
- name: redis
- name: "docker.elastic.co/elasticsearch/elasticsearch:7.10.1"
alias: "elasticsearch"
command: [ "bin/elasticsearch", "-Expack.security.enabled=false", "-Ediscovery.type=single-node" ]
# 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/