-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
executable file
·123 lines (115 loc) · 3.35 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
stages:
- setup
- style
- quality
- test
- package
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
variables:
DOCKER_DRIVER: overlay2
BASE_SW_VERSION: '6.4.12.0'
PHP_VERSION: '7.4'
DOCKWARE_CI: '1'
COMPOSER_COMMAND: "composer install --prefer-dist --no-ansi --no-interaction --no-progress --optimize-autoloader"
before_script:
- cp -r ${CI_PROJECT_DIR} /var/www/html/custom/plugins/${CI_PROJECT_NAME}
composer:
stage: setup
image: "dockware/dev:${BASE_SW_VERSION}"
script:
- cd /var/www/html/custom/plugins/${CI_PROJECT_NAME} && ${COMPOSER_COMMAND} && cp -r /var/www/html/custom/plugins/${CI_PROJECT_NAME}/vendor ${CI_PROJECT_DIR}
artifacts:
paths:
- vendor/
expire_in: 1 days
when: always
cache:
key: global
paths:
- vendor
codestyle:
stage: style
image: "dockware/dev:${BASE_SW_VERSION}"
needs: ["composer"]
dependencies:
- composer
except:
variables: [ $DISABLE_PHP_CS_FIXER == "1" ]
script:
- cd /var/www/html/custom/plugins/${CI_PROJECT_NAME} && ${COMPOSER_COMMAND} && vendor/bin/php-cs-fixer fix -v --dry-run
cache:
key: global
paths:
- vendor
policy: pull
phpstan:
stage: quality
image: "dockware/dev:${SW_VERSION}"
parallel:
matrix:
- PHP_VERSION: [ "7.4", "8.0", "8.1" ]
SW_VERSION: [ "6.4.12.0", "6.4.18.0", "latest" ]
needs: ["composer"]
dependencies:
- composer
except:
variables: [ $DISABLE_PHPSTAN == "1" ]
script:
- cd /var/www/html/custom/plugins/${CI_PROJECT_NAME} && vendor/bin/phpstan analyse -c phpstan.neon -a vendor/autoload.php -a ../../../vendor/autoload.php src tests
cache:
key: global
paths:
- vendor
policy: pull
install:
stage: test
image: "dockware/dev:${SW_VERSION}"
parallel:
matrix:
- PHP_VERSION: [ "7.4", "8.0", "8.1" ]
SW_VERSION: [ "6.4.12.0", "6.4.18.0", "latest" ]
needs: ["composer"]
dependencies:
- composer
except:
variables: [ $DISABLE_INSTALL == "1" ]
script:
- cd /var/www/html && php bin/console plugin:refresh
- cd /var/www/html && php bin/console plugin:install --clearCache --activate ${CI_PROJECT_NAME}
- cd /var/www/html && php bin/console plugin:list
cache:
key: global
paths:
- vendor
policy: pull
build:pack-plugin:
stage: package
image:
name: ghcr.io/friendsofshopware/platform-plugin-dev:${BASE_SW_VERSION}
entrypoint: [""]
only:
- tags
- main
- /^integration.*$/
- /^fix.*$/
needs: []
dependencies: []
except:
variables: [ $DISABLE_PACKAGE == "1" ]
script:
- start-mysql
- ln -s "$(pwd)" "/plugins/${CI_PROJECT_NAME}"
- plugin-uploader ext:prepare "/plugins/${CI_PROJECT_NAME}"
- rm -rf $( cat .sw-zip-blocklist ) && rm -rf .sw-zip-blocklist
- pack-plugin ${CI_PROJECT_NAME}
- plugin-uploader ext:validate "$(realpath "${CI_PROJECT_NAME}.zip")"
artifacts:
paths:
- "${CI_PROJECT_NAME}.zip"
expire_in: 1 week
cache:
key: global
paths:
- vendor
policy: pull