-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
105 lines (86 loc) · 3.71 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
language: php
dist: xenial
addons:
chrome: stable
php:
- '8.0'
services:
- mysql
cache:
yarn: true
directories:
- ~/.composer/cache/files
- $MONOFONY_CACHE_DIR
env:
global:
- APP_ENV=test
- IS_DOCTRINE_ORM_SUPPORTED=true
- DATABASE_URL=mysql://[email protected]:3306/monofony_%kernel.environment%?serverVersion=5.7
- MONOFONY_CACHE_DIR=$HOME/.monofony-cache
- MONOFONY_BUILD_DIR=etc/build
before_install:
- nvm install 12
- nvm use 12
- phpenv config-rm xdebug.ini
- echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- mkdir -p "${MONOFONY_CACHE_DIR}"
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 https://localhost:8080 &
install:
- composer install --no-interaction --prefer-dist
- composer dump-env test
- yarn install
before_script:
- bin/console doctrine:database:create -vvv
- APP_DEBUG=1 APP_ENV=dev bin/console cache:warmup -vvv # For PHPStan
- bin/console doctrine:migration:migrate -n -vv
- bin/console assets:install public -vvv
- bin/console cache:warmup -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 Symfony CLI
- |
if [ ! -f $MONOFONY_CACHE_DIR/symfony ]; then
wget https://get.symfony.com/cli/installer -O - | bash
mv ~/.symfony/bin/symfony $MONOFONY_CACHE_DIR
fi
# Download and configure ChromeDriver
- |
if [ ! -f $MONOFONY_CACHE_DIR/chromedriver ] || [ "$($MONOFONY_CACHE_DIR/chromedriver --version | grep -c 87.0)" = "0" ]; then
curl https://chromedriver.storage.googleapis.com/87.0.4280.88/chromedriver_linux64.zip > chromedriver.zip
unzip chromedriver.zip
chmod +x chromedriver
mv chromedriver $MONOFONY_CACHE_DIR
fi
# Run ChromeDriver
- $MONOFONY_CACHE_DIR/chromedriver > /dev/null 2>&1 &
# Download and configure Selenium
- |
if [ ! -f $MONOFONY_CACHE_DIR/selenium.jar ] || [ "$(java -jar $MONOFONY_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 $MONOFONY_CACHE_DIR
fi
# Run Selenium
- java -Dwebdriver.chrome.driver=$MONOFONY_CACHE_DIR/chromedriver -jar $MONOFONY_CACHE_DIR/selenium.jar > /dev/null 2>&1 &
# Run webserver
- $MONOFONY_CACHE_DIR/symfony server:ca:install
- $MONOFONY_CACHE_DIR/symfony server:start --port=8080 --dir=public --force-php-discovery --daemon
script:
- composer validate --strict
- $MONOFONY_CACHE_DIR/symfony security:check
- bin/console doctrine:schema:validate -vvv
- bin/console lint:twig templates
- bin/console lint:yaml config --parse-tags
- phpdbg -qrr vendor/bin/phpspec run --no-interaction -f dot
- vendor/bin/phpstan analyse -c phpstan.neon -l 1 src
- vendor/bin/psalm --show-info=false
- vendor/bin/phpunit
- bin/console app:install --no-interaction -vvv
- bin/console sylius:fixtures:load default --no-interaction
- vendor/bin/behat --strict -vvv --no-interaction -f progress || vendor/bin/behat --strict -vvv --no-interaction -f progress --rerun
- (bin/console doctrine:migrations:migrate first --no-interaction && bin/console doctrine:migrations:migrate latest --no-interaction)
after_failure:
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${MONOFONY_BUILD_DIR}/*.log"
notifications:
email: false