forked from shopware/SwagMigrationMagento
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
66 lines (62 loc) · 2.75 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
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: "tcp://docker:2375"
MYSQL_ROOT_PASSWORD: app
WEB_DOCUMENT_ROOT: $CI_PROJECT_DIR/development/public
stages:
- Static analyzes
- PHPUnit
default:
image: shopware/development:latest
before_script:
- zip -rq plugin.zip .
- git clone --branch 6.1 http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/6/product/development.git
- rm -rf development/platform
- git clone --branch 6.1 http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/6/product/platform.git development/platform
- git clone http://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.shopware.com/shopware/6/services/migration-assistant.git development/custom/plugins/SwagMigrationAssistant
- unzip -q plugin.zip -d development/custom/plugins/SwagMigrationMagento
- cd development
- cp -v dev-ops/gitlab/.psh.yaml.override .
- /entrypoint supervisord > /dev/null 2>&1 &
PHP analyze:
stage: Static analyzes
services:
- name: mysql:5.7
alias: mysql
script:
- ./psh.phar init
- php bin/console plugin:install --activate SwagMigrationAssistant
- php bin/console plugin:install --activate SwagMigrationMagento
- php dev-ops/analyze/vendor/bin/php-cs-fixer fix --config=vendor/shopware/platform/.php_cs.dist --dry-run -vvv --allow-risky=yes --format=junit custom/plugins/SwagMigrationMagento | tee php-cs-fixer.xml
- cd $CI_PROJECT_DIR/development/custom/plugins/SwagMigrationMagento
- bin/static-analyze.sh
artifacts:
reports:
junit: development/php-cs-fixer.xml
PHPUnit (MariaDB):
stage: PHPUnit
needs: [PHP analyze]
services:
- name: mariadb:10.3
alias: mysql
script:
- ./psh.phar init
- php bin/console plugin:install --activate SwagMigrationAssistant
- php bin/console plugin:install --activate SwagMigrationMagento
- composer dump-autoload -d custom/plugins/SwagMigrationMagento
- composer dump-autoload -d custom/plugins/SwagMigrationAssistant
- ./psh.phar init-test-databases
- php -d pcov.enabled=1 -d pcov.directory=$CI_PROJECT_DIR
vendor/bin/phpunit
--configuration custom/plugins/SwagMigrationMagento/phpunit.xml.dist
--log-junit build/artifacts/phpunit.junit.xml
--colors=never
--coverage-clover build/artifacts/phpunit.clover.xml
--coverage-html build/artifacts/phpunit-coverage-html
--coverage-text
coverage: '/^\s*Lines:\s*(\d+(?:\.\d+)?%)/'
artifacts:
paths:
- development/build/artifacts/phpunit.clover.xml
reports:
junit: development/build/artifacts/phpunit.junit.xml