|
@@ -1,5 +1,7 @@
|
|
|
stages:
|
|
stages:
|
|
|
|
|
+ - build
|
|
|
- test
|
|
- test
|
|
|
|
|
+ - analysis
|
|
|
|
|
|
|
|
variables:
|
|
variables:
|
|
|
APP_ENV: staging
|
|
APP_ENV: staging
|
|
@@ -9,14 +11,29 @@ variables:
|
|
|
cache:
|
|
cache:
|
|
|
paths:
|
|
paths:
|
|
|
- ./vendor
|
|
- ./vendor
|
|
|
|
|
+ - ./composer.lock
|
|
|
|
|
+ - ~/.composer/cache
|
|
|
|
|
|
|
|
-before_script:
|
|
|
|
|
- - bash tests/ci_docker_install.sh > /dev/null
|
|
|
|
|
- - php -v
|
|
|
|
|
|
|
+build_image:
|
|
|
|
|
+ stage: build
|
|
|
|
|
+ image: docker:20.10
|
|
|
|
|
+ before_script:
|
|
|
|
|
+ - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
|
|
|
+ script:
|
|
|
|
|
+ - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
|
|
|
|
|
+ - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
|
|
|
|
|
+ - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
|
|
|
|
+ - docker push $CI_REGISTRY_IMAGE:latest
|
|
|
|
|
+
|
|
|
|
|
+.default_config: &default_config
|
|
|
|
|
+ image: $CI_REGISTRY_IMAGE:latest
|
|
|
|
|
+ before_script:
|
|
|
|
|
+ - composer config -g cache-dir .composer-cache
|
|
|
|
|
+ - HOST=ci composer install --prefer-dist --no-progress --no-interaction
|
|
|
|
|
|
|
|
unit:
|
|
unit:
|
|
|
|
|
+ <<: *default_config
|
|
|
stage: test
|
|
stage: test
|
|
|
-
|
|
|
|
|
script:
|
|
script:
|
|
|
- php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml.dist --colors=never --no-interaction --testsuite=unit
|
|
- php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml.dist --colors=never --no-interaction --testsuite=unit
|
|
|
#- php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml.dist --colors=never --no-interaction --no-coverage --testsuite=application
|
|
#- php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml.dist --colors=never --no-interaction --no-coverage --testsuite=application
|
|
@@ -31,10 +48,14 @@ unit:
|
|
|
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
|
|
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
|
|
|
|
|
|
|
|
#doctrine:
|
|
#doctrine:
|
|
|
|
|
+# <<: *default_config
|
|
|
|
|
+# stage: test
|
|
|
# script:
|
|
# script:
|
|
|
# - php bin/console d:s:v
|
|
# - php bin/console d:s:v
|
|
|
|
|
|
|
|
-static_analysis:
|
|
|
|
|
|
|
+code_quality:
|
|
|
|
|
+ <<: *default_config
|
|
|
|
|
+ stage: analysis
|
|
|
script:
|
|
script:
|
|
|
- php vendor/bin/phpstan analyse -c phpstan.neon.dist --error-format gitlab > phpstan.json # Display code quality in MR
|
|
- php vendor/bin/phpstan analyse -c phpstan.neon.dist --error-format gitlab > phpstan.json # Display code quality in MR
|
|
|
- php vendor/bin/phpstan analyse -c phpstan.neon.dist
|
|
- php vendor/bin/phpstan analyse -c phpstan.neon.dist
|
|
@@ -44,8 +65,10 @@ static_analysis:
|
|
|
codequality: phpstan.json
|
|
codequality: phpstan.json
|
|
|
|
|
|
|
|
code_style:
|
|
code_style:
|
|
|
|
|
+ <<: *default_config
|
|
|
|
|
+ stage: analysis
|
|
|
|
|
+ before_script:
|
|
|
|
|
+ - composer config -g cache-dir .composer-cache
|
|
|
|
|
+ - HOST=ci composer install --prefer-dist --no-progress --no-interaction
|
|
|
script:
|
|
script:
|
|
|
- php vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php
|
|
- php vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|