Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
156 lines (112 sloc) 5.95 KB
language: php
dist: trusty
php:
- 7.2
env:
global:
- APP_ENV=test_cached
jobs:
include:
- &test
stage: test
name: "Symfony 3.4.* build"
sudo: false
env: SYMFONY_VERSION="3.4.*" SYLIUS_CACHE_DIR=$HOME/.sylius-cache SYLIUS_BUILD_DIR=etc/build
cache:
yarn: true
directories:
- ~/.composer/cache/files
- $SYLIUS_CACHE_DIR
services:
- memcached
- mysql
before_install:
- phpenv config-rm xdebug.ini || true
- echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
install:
- if [ ! -z "${SYMFONY_VERSION}" ]; then bin/require-symfony-version composer.json "${SYMFONY_VERSION}"; fi
- composer update --no-interaction --prefer-dist
- yarn install
before_script:
- APP_DEBUG=1 bin/console doctrine:database:create -vvv # Have to be run with debug = true, to omit generating proxies before setting up the database
- bin/console cache:warmup -vvv
- bin/console doctrine:migrations:migrate --no-interaction -vvv
- bin/console assets:install public -vvv
- yarn build
# Configure display
- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16
- export DISPLAY=:99
# Download and configure ChromeDriver
- |
if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c 2.34)" = "0" ]; then
curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip
unzip chromedriver.zip
chmod +x chromedriver
mv chromedriver $SYLIUS_CACHE_DIR
fi
# Run ChromeDriver
- $SYLIUS_CACHE_DIR/chromedriver > /dev/null 2>&1 &
# Download and configure Selenium
- |
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.4.0)" = "0" ]; then
curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar
mv selenium.jar $SYLIUS_CACHE_DIR
fi
# Run Selenium
- java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 &
# Run webserver
- bin/console server:run localhost:8080 -d public --quiet > /dev/null 2>&1 &
script:
- composer validate --strict
- vendor/bin/security-checker security:check
- vendor/bin/ecs check src
- vendor/bin/phpspec run --no-interaction -f dot
- bin/console sylius:fixtures:load --no-interaction -vvv
- echo "Testing (Behat, without javascript scenarios; ~@javascript && ~@todo && ~@cli)" "Sylius"
- vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="~@javascript && ~@todo && ~@cli"
- echo "Testing (Behat, only javascript scenarios; @javascript && ~@todo && ~@cli)" "Sylius"
- vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@javascript && ~@todo && ~@cli" || vendor/bin/behat --strict --no-interaction -vvv -f progress --tags="@javascript && ~@todo && ~@cli" --rerun
after_failure:
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"
- IMGUR_API_KEY=4907fcd89e761c6b07eeb8292d5a9b2a vendor/lakion/mink-debug-extension/travis/tools/upload-screenshots "${SYLIUS_BUILD_DIR}/*.png"
- <<: *test
name: "Symfony 4.2.* build"
env: SYMFONY_VERSION="4.2.*" SYLIUS_CACHE_DIR=$HOME/.sylius-cache SYLIUS_BUILD_DIR=etc/build
-
stage: test
name: "Docker build"
sudo: required
env: DOCKER_COMPOSE_VERSION=1.22.0
services:
- docker
addons:
apt:
packages:
- docker-ce
before_install:
# Install custom version of docker-composer
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
# Shutdown vanilla mysql
- sudo service mysql stop
- while sudo lsof -Pi :3306 -sTCP:LISTEN -t; do sleep 1; done
script:
- docker-compose --version
- docker-compose pull --ignore-pull-failures || true
- docker-compose build --pull
- docker-compose up -d
- sleep 60
- docker-compose exec php bin/console sylius:fixtures:load --no-interaction
- curl http://localhost/
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin "$DOCKER_REGISTRY"
deploy:
provider: script
script: docker-compose push
skip_cleanup: true
on:
repo: Sylius/Sylius-Standard
tags: true