forked from nedac-sorbo/SyliusMinimumOrderValuePlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
97 lines (81 loc) · 3.3 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
language: php
os: linux
dist: bionic
php:
- '7.4'
cache:
yarn: true
directories:
- ~/.composer/cache/files
- $SYLIUS_CACHE_DIR
env:
global:
- APP_ENV=test
- SYLIUS_CACHE_DIR=$HOME/.sylius-cache
- SYLIUS_BUILD_DIR=etc/build
before_install:
- phpenv config-rm xdebug.ini
- sudo fallocate -l 4G /var/swap.1
- sudo /sbin/mkswap /var/swap.1
- sudo /sbin/swapon /var/swap.1
- echo "memory_limit=4096M" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- mkdir -p "${SYLIUS_CACHE_DIR}"
- composer config -g github-oauth.github.com "$TOKEN"
- >
([[ ! -z "$TEST_APP_VERSION" ]] && [[ "1.6" == "$TEST_APP_VERSION" ]] && composer require "sylius/sylius:>=1.6.8 <1.7.0" --no-update && composer require sylius/bootstrap-theme:^0.1.2 --no-update); (cd tests/Application && git checkout $TEST_APP_VERSION);
install:
- composer install --no-interaction --prefer-dist
- (cd tests/Application && yarn install)
before_script:
- (cd tests/Application && bin/console doctrine:database:create -vvv)
- (cd tests/Application && bin/console doctrine:schema:create -vvv)
- (cd tests/Application && bin/console assets:install public -vvv)
- (cd tests/Application && bin/console cache:warmup -vvv)
- ([[ ! -z "$TEST_APP_VERSION" ]] && [[ "1.6" == "$TEST_APP_VERSION" ]] && (cd tests/Application && yarn build)) || (cd tests/Application && yarn encore prod)
# 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 80.0.3987.106)" = "0" ]; then
curl https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_linux64.zip > chromedriver.zip
unzip chromedriver.zip
chmod +x chromedriver
mv chromedriver $SYLIUS_CACHE_DIR
fi
# Run ChromeDriver
- $SYLIUS_CACHE_DIR/chromedriver > $SYLIUS_BUILD_DIR/chromedriver.log 2>&1 &
# Download and configure Selenium
- |
if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.141.59)" = "0" ]; then
curl http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.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 > $SYLIUS_BUILD_DIR/selenium.log 2>&1 &
# Run webserver
- (cd tests/Application && bin/console server:run 127.0.0.1:8080 > ../../$SYLIUS_BUILD_DIR/symfony.log 2>&1 &)
jobs:
include:
- name: Sylius 1.7 Bootstrap Theme
env:
- TEST_APP_VERSION=master
- name: Sylius 1.7
env:
- TEST_APP_VERSION=master
- name: Sylius 1.6
env:
- TEST_APP_VERSION=1.6
script:
- composer validate
- vendor/bin/phpcs
- vendor/bin/phpstan analyse -c phpstan.neon -l max src/
- vendor/bin/phpunit
- ./run-behat.sh
after_failure:
- ls -lah ${SYLIUS_BUILD_DIR}
- vendor/lakion/mink-debug-extension/travis/tools/upload-textfiles "${SYLIUS_BUILD_DIR}/*.log"
services:
- mysql
notifications:
slack: nedac:Wt39TfJNxJlC94qy0WvHTuPB