-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
158 lines (114 loc) · 6.13 KB
/
.travis.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
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
- echo "Testing prod requirements (Composer)" "Sylius"
- APP_ENV=prod && APP_DEBUG=0 && composer install --no-dev --no-interaction --prefer-dist
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