forked from spryker-shop/b2c-demo-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
343 lines (275 loc) · 12.8 KB
/
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
name: CI
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
validation:
name: "Static analysis / PHP 8.0"
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
php-version: [
'8.0',
]
env:
APPLICATION_ENV: devtest
APPLICATION_STORE: DE
PROJECT: suite
services:
redis:
image: redis
ports:
- 6379/tcp
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 7.6.0
port: 10005
- uses: actions/setup-node@v1
with:
node-version: '16'
- name: NPM cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, pdo_mysql, redis
tools: composer:v2
- name: Composer get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer validate
run: composer validate
- name: Composer version
run: composer --version
- name: Composer install
run: composer install
- name: Generate transfer objects
run: vendor/bin/console transfer:generate
- name: Generate transfer databuilder objects
run: vendor/bin/console transfer:databuilder:generate
- name: Propel install
run: |
vendor/bin/console propel:schema:copy
vendor/bin/console propel:model:build
vendor/bin/console transfer:entity:generate
- name: Setup search
run: vendor/bin/console setup:search
- name: Codecept build
run: vendor/bin/codecept build --ansi
- name: Generate autocompletion files
run: vendor/bin/console dev:ide-auto-completion:generate
- name: Generate rest API dcoumentation
run: vendor/bin/console rest-api:generate:documentation
- name: Frontend install-dependencies
run: |
vendor/bin/console frontend:project:install-dependencies -vvv
- name: Install NPM packages
run: |
sudo npm install -g --unsafe-perm speccy@0.11.0
- name: Speccy lint Glue specification
run: speccy lint src/Generated/Glue/Specification/spryker_rest_api.schema.yml --rules=default
- name: Style lint
run: node ./frontend/libs/stylelint
- name: TS lint
run: node ./frontend/libs/tslint --format stylish
- name: Front-end Formatter
run: node ./frontend/libs/formatter
- name: Validate propel files
run: |
vendor/bin/console propel:schema:validate
vendor/bin/console propel:schema:validate-xml-names
- name: Validate transfer files
run: vendor/bin/console transfer:validate
- name: Run CodeStyle checks
run: vendor/bin/console code:sniff:style
- name: Run Architecture rules
run: vendor/bin/phpmd src/ text vendor/spryker/architecture-sniffer/src/ruleset.xml --minimumpriority 2
- name: Run PHPStan
run: vendor/bin/phpstan analyze -l 5 -c phpstan.neon src/ --debug
- name: Run Security check
run: vendor/bin/console security:check
php-80-mariadb-glue-alpine:
name: "PHP 8.0 / MariaDB / Glue / Alpine"
runs-on: ubuntu-18.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.0
TRAVIS: 1
steps:
- uses: actions/checkout@v2
- name: Install apt-packages
run: |
sudo apt-get install apache2-utils
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Run docker
run: |
git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot deploy.ci.api.mariadb.yml -v
docker/sdk up -t -v
docker/sdk testing codecept fixtures
docker/sdk testing console queue:worker:start --stop-when-empty
docker/sdk testing codecept run -c codeception.api.yml
php-80-postgresql-acceptance-alpine:
name: "PHP 8.0 / PostgreSQL / Acceptance / Alpine"
runs-on: ubuntu-18.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.0
TRAVIS: 1
steps:
- uses: actions/checkout@v2
- name: Install apt-packages
run: |
sudo apt-get install apache2-utils
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Run docker
run: |
git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot -v deploy.ci.acceptance.yml
docker/sdk up -t
docker/sdk testing console queue:worker:start --stop-when-empty
docker/sdk testing codecept run -c codeception.acceptance.yml
php-80-postgresql-functional-alpine:
name: "PHP 8.0 / PostgreSQL / Functional / Alpine"
runs-on: ubuntu-18.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.0
TRAVIS: 1
steps:
- uses: actions/checkout@v2
- name: Install apt-packages
run: |
sudo apt-get install apache2-utils
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Run docker
run: |
git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot -v deploy.ci.acceptance.yml
docker/sdk up -t
docker/sdk testing console queue:worker:start --stop-when-empty
docker/sdk testing codecept run -c codeception.functional.yml
php-80-mariadb-acceptance-alpine:
name: "PHP 8.0 / MariaDB / Acceptance / Alpine"
runs-on: ubuntu-18.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.0
TRAVIS: 1
steps:
- uses: actions/checkout@v2
- name: Install apt-packages
run: |
sudo apt-get install apache2-utils
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Run docker
run: |
git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot -v deploy.ci.acceptance.mariadb.yml
docker/sdk up -t
docker/sdk testing console queue:worker:start --stop-when-empty
docker/sdk testing codecept run -c codeception.acceptance.yml
php-80-mariadb-functional-alpine:
name: "PHP 8.0 / MariaDB / Functional / Alpine"
runs-on: ubuntu-18.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.0
TRAVIS: 1
steps:
- uses: actions/checkout@v2
- name: Install apt-packages
run: |
sudo apt-get install apache2-utils
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Run docker
run: |
git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot deploy.ci.functional.mariadb.yml -v
docker/sdk up -t -v
docker/sdk testing codecept run -c codeception.functional.yml
php-80-postgres-functional-debian:
name: "PHP 8.0 / PostgreSQL / Functional / Debian"
runs-on: ubuntu-18.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.0-debian
TRAVIS: 1
steps:
- uses: actions/checkout@v2
- name: Install apt-packages
run: |
sudo apt-get install apache2-utils
- name: Install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Run docker
run: |
git clone https://github.com/spryker/docker-sdk.git ./docker
docker/sdk boot deploy.ci.functional.yml -v
docker/sdk up -t -v
docker/sdk testing codecept run -c codeception.functional.yml
frontend-assets-via-docker-php-8-0:
name: "Docker / Alpine / PHP 8.0 / Frontend & Assets"
runs-on: ubuntu-18.04
env:
PROGRESS_TYPE: plain
SPRYKER_PLATFORM_IMAGE: spryker/php:8.0
steps:
- uses: actions/checkout@v2
- run: echo eyAiZXhwZXJpbWVudGFsIiA6IHRydWUsICJmZWF0dXJlcyIgOiB7ICJidWlsZGtpdCI6IHRydWUgfSB9Cg==|base64 -d|sudo tee /etc/docker/daemon.json
- run: sudo apt-get install --only-upgrade docker -y
- run: sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- run: sudo chmod +x /usr/local/bin/docker-compose
- run: git clone https://github.com/spryker/docker-sdk.git --single-branch --branch master ./docker
- run: docker/sdk boot deploy.yml
- run: SPRYKER_BUILD_HASH=myhash docker/sdk export images
- run: docker run -t --rm -e SPRYKER_NGINX_CGI_HOST_YVES_EU=localhost -e SPRYKER_NGINX_CGI_HOST_ZED_EU=localhost -e SPRYKER_NGINX_CGI_HOST_GLUE_EU=localhost -e SPRYKER_NGINX_CGI_HOST_YVES_US=localhost -e SPRYKER_NGINX_CGI_HOST_GLUE_US=localhost -e SPRYKER_NGINX_CGI_HOST_ZED_US=localhost -e ALLOWED_IP=127.0.0.1 spryker_b2c_frontend:1.0-frontend nginx -t
- run: docker run -t --rm --entrypoint='' spryker_b2c_frontend:1.0-frontend ls -al /data/public/Yves/assets/myhash
- run: docker run -t --rm --entrypoint='' spryker_b2c_frontend:1.0-frontend ls -al /data/public/Zed/assets/