-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
96 lines (89 loc) · 3.01 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
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: "tcp://docker:2375"
DOCKER_TLS_CERTDIR: "/certs"
MYSQL_ROOT_PASSWORD: root
GIT_STRATEGY: clone
WEB_DOCUMENT_ROOT: $CI_PROJECT_DIR/
COMPOSER_HOME: $CI_PROJECT_DIR/.composer
default:
tags:
- t3.nano
stages:
- Static analysis
- Test
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .composer
Php Cs Fixer:
stage: Static analysis
image: webdevops/php-apache:7.4
before_script:
- composer install --working-dir=tools
script:
- ./psh.phar cs-fixer-dry
PHPStan:
stage: Static analysis
tags:
- t3.medium
image: gitlab.shopware.com:5005/shopware/5/product/image/continuous:7.4
services:
- name: mysql:8.0
alias: mysql_master
command: [ "mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--default-authentication-plugin=mysql_native_password" ]
before_script:
- apk add --no-cache mysql-client coreutils
- ./psh.phar init
- shopware/bin/console -q
script:
- ./psh.phar phpstan
ParallelUnit:
stage: Test
tags:
- t3.medium
image: gitlab.shopware.com:5005/shopware/5/product/image/continuous:$PHP_VERSION
services:
- name: mysql:8.0
alias: mysql_master
command: [ "mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--default-authentication-plugin=mysql_native_password", "--server-id=1", "--log_bin=mysql-bin" ]
- name: mysql:8.0
alias: mysql_slave
command: [ "mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--default-authentication-plugin=mysql_native_password", "--server-id=2", "--log_bin=mysql-bin"]
- name: redis:latest
alias: app_redis
command: [ "redis-server", "--requirepass app" ]
parallel:
matrix:
- SHOPWARE_VERSION: [ "~5.6.0" ]
PHP_VERSION: [
'7.2',
'7.3'
]
- SHOPWARE_VERSION: [ "~5.7.0" ]
PHP_VERSION: [
'8.0',
'7.4'
]
before_script:
- apk add --no-cache mysql-client coreutils
- composer install --working-dir=tools
- composer config platform.php $PHP_VERSION
- ./psh.phar set-branch --VERSION=$SHOPWARE_VERSION
- >
if [[ $SHOPWARE_VERSION = "~5.6.0" ]]; then
rm composer.lock
composer install
else
if [[ $PHP_VERSION = "8.0" ]]; then
composer update --with-all-dependencies
else
composer install
fi
fi
- ./psh.phar init
- ./psh.phar essentials-on --module=RedisStore
- ./psh.phar essentials-on --module=PrimaryReplica
- ./psh.phar activate-master-slave
script:
- ./psh.phar unit