Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stages:
- - test
- variables:
- MYSQL_DATABASE: sylius_test_cached
- MYSQL_ROOT_PASSWORD: root
- MYSQL_USER: root
- DATABASE_URL: mysql://root:root@mysql/sylius_test_cached
- # Set memory limit to infinite to avoid running out of memory issues
- COMPOSER_MEMORY_LIMIT: -1
- # Set the environments variables manually
- APP_ENV: test_cached
- APP_DEBUG: 1
- APP_SECRET: 1542752314
- MAILER_URL: smtp://localhost
- PHP_DATE_TIMEZONE: Europe/Copenhagen
- cache:
- key: $CI_BUILD_REF_NAME # changed to $CI_COMMIT_REF_NAME in Gitlab 9.x
- paths:
- - vendor
- - node_modules
- - public
- - .yarn
- test:
- stage: test
- # Its there for easy switching
- allow_failure: false
- services:
- - mysql:5.7
- - memcached
- # This image is optimzed for Laravel but works for Sylius as well
- image: edbizarro/gitlab-ci-pipeline-php:7.2-alpine
- before_script:
- - sudo yarn config set cache-folder .yarn
- script:
- - composer global require hirak/prestissimo # Speed up the composer install process
- # Install the dependencies. Don't execute scripts because the cache clean up take too long, sometimes times out
- - composer install --prefer-dist --no-ansi --no-scripts --no-interaction --no-progress --no-suggest
- - mkdir -p public/media/cache && mkdir -p public/media/image # Prevent error: public/media/image folder not found
- - bin/console doctrine:database:create --if-not-exists --env=test_cached -vvv # Have to run with debug = true, to omit generation proxies before setting up the database
- - yarn install
- - bin/console sylius:theme:assets:install public
- - bin/console sylius:install:assets
- - yarn build
- - bin/console cache:warmup --env=test_cached --no-debug -vvv
- - bin/console doctrine:migrations:migrate --no-interaction --env=test_cached --no-debug -vvv
- # Checking code style
- - vendor/bin/phpcs -n --standard=PSR2 src
- - vendor/bin/security-checker security:chec
- - vendor/bin/phpspec run --no-interaction -f dot
- - bin/console sylius:fixtures:load --no-interaction --env=test_cached --no-debug -vvv
- - bin/console server:run 127.0.0.1:8080 -d web --env test_cached > /dev/null 2>&1 &
- - echo "Starting BEHAT tests."
- - cp behat.yml.dist behat.yml
- - php bin/behat
- - echo "BEHAT tests done."
Add Comment
Please, Sign In to add comment