forked from ezsystems/ezplatform-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (92 loc) · 4.81 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
dist: xenial
sudo: required
language: php
services:
- mysql
- postgresql
- redis-server
cache:
directories:
- $HOME/.composer/cache/files
env:
global:
# For functional and acceptance tests
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/selenium.yml"
- PHP_INI_ENV_memory_limit=512M
# In order to specify extra flags like ignoring platform reqs, using only stable packages and so on.
- COMPOSER_FLAGS=""
- COMPOSER_MEMORY_LIMIT=4G
matrix:
fast_finish: true
include:
# 7.3
- name: 'Unit tests'
php: 7.3
env: TEST_CONFIG="phpunit.xml"
- name: "Kernel Behat Core tests"
php: 7.3
env:
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/selenium.yml"
- BEHAT_OPTS="--profile=core --tags=~@broken"
- APP_ENV=behat
- APP_DEBUG=1
- name: 'Solr 7.7.3 integration tests (using shared cores) with Redis cache pool'
php: 7.3
env: SOLR_VERSION="7.7.3" TEST_CONFIG="phpunit-integration-legacy-solr.xml" CUSTOM_CACHE_POOL="singleredis" CORES_SETUP="shared" SOLR_CONFIG="vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/schema.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/custom-fields-types.xml vendor/ezsystems/ezplatform-solr-search-engine/lib/Resources/config/solr/language-fieldtypes.xml" JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/"
- name: 'PostgreSQL integration tests'
php: 7.3
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
- name: 'MySQL integration tests'
php: 7.3
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb"
- name: 'Code Style Check'
php: 7.3
env: CHECK_CS=1
# 7.4
- php: 7.4
env: TEST_CONFIG="phpunit.xml"
- php: 7.4
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
# test only master, stable branches and pull requests
branches:
only:
- master
- /^\d.\d+$/
# setup requirements for running unit/integration/behat tests
before_install:
# Disable memory_limit for composer
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Disable XDebug for all jobs as we don't generate test coverge on travis
- phpenv config-rm xdebug.ini
# make sure we use UTF-8 encoding
- echo "default_charset=UTF-8" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Install igbinary & lzf PHP extensions if necessary
- if [ "$ENABLE_IGBINARY" = true ] ; then pecl install igbinary ; fi
- if [ "$ENABLE_LZF" = true ] ; then printf "no\n" | pecl install lzf ; fi
# Prepare system
- if [ "$TEST_CONFIG" != "" ] ; then ./bin/.travis/prepare_unittest.sh ; fi
- if [ "$BEHAT_OPTS" != "" ] ; then ./bin/.travis/prepare_behat.sh ; fi
# Execute Symfony command if specified
- if [ "$SF_CMD" != "" ] ; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "bin/console $SF_CMD" ; fi
# Detecting timezone issues by testing on random timezone
- TEST_TIMEZONES=("America/New_York" "Asia/Calcutta" "UTC")
- TEST_TIMEZONE=${TEST_TIMEZONES["`shuf -i 0-2 -n 1`"]}
install:
- if [ "$TEST_CONFIG" != "" -o "$CHECK_CS" = "1" ] ; then travis_retry composer install --no-progress --no-interaction --prefer-dist $COMPOSER_FLAGS; fi
# Setup Solr search if asked for
- if [ "$TEST_CONFIG" = "phpunit-integration-legacy-solr.xml" ] ; then ./vendor/ezsystems/ezplatform-solr-search-engine/bin/.travis/init_solr.sh; fi
# execute phpunit or behat as the script command
script:
- if [ "$TEST_CONFIG" != "" ] ; then php -d date.timezone=$TEST_TIMEZONE -d memory_limit=-1 vendor/bin/phpunit -c $TEST_CONFIG ; fi
- if [ "$BEHAT_OPTS" != "" ] ; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "bin/behat $BEHAT_OPTS" ; fi
- if [ "$CHECK_CS" = "1" ] ; then ./bin/.travis/check_code_style.sh; fi
notifications:
slack:
rooms:
- secure: "ppsQAlgeuJl6fgQvo2bg4ehVBeoE/7FYzVK/c0kqqUFozLYnQAoyhTx+uYPTXoKqpOfr0ftnByq27Mtmzbh27KhQSXq8AP/V3WOEqwfFnvHNZJ0aXVK/myE8jqc5rMNhIXcCP0jGxO0CjJtOKkn0+pLQhJ7iILGDi+WvS+5bn3KQfV2WaFmzfG/y0ZxBW/YY7GI3Nv7eo44qHaUWky0JtJbFQaV3Bh1H0Vv25aGUWr5k2WQefERpks1dW0AEhafdOqmzGdNyXkAcECVfSCL6kAjOS4TsvtQCC1yl410DS0lHz0h9oX3uv7yPq+biF2/5hm3YMrmw1srZrVyUqAyejGrBXp6kLkgCKo1kPZAzDF0BYz0T6lF1IZAeCg9eZAhBwCckVeYOJrYJj7iqqmWkjJrmH/nn9y8x40tZfwOfequGAE+341xbNErznAjlzbLTuBgp3H70PxbOjQn80IeaagymxdyP9QyU7HwL6lNKC3ZiCXQPVR5HY/6cR0vzIYC4t74onWEy8XqNny08KgvSLVL0HMD9YwOElVxJsTX1mmG67kElMaeTq2SrgAxFPnhA3mc4Y93DWTBdAIEiq16KQT4pqjUpsHUo/Hn+oLAS2MX64e+zFB2rELHvbYaLZzfe05rp83Y59RZt9XaAcJ0brsPm+ONqVRQfvI0kTNpIC80="
on_success: change
on_failure: always
on_pull_requests: false
# reduce depth (history) of git checkout
git:
depth: 30