Skip to content

Commit

Permalink
EZP-30315 [Travis] Standarize and clean up travis configurations acro…
Browse files Browse the repository at this point in the history
…ss the repositories
  • Loading branch information
m-tyrala committed May 14, 2019
1 parent 502b594 commit b916c4f
Showing 1 changed file with 42 additions and 35 deletions.
77 changes: 42 additions & 35 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Use trusty for better performance (and avoiding mysql/postgres/solr gone issues on precise and container infra)
dist: trusty
sudo: false

language: php

env:
global:
- EZPLATFORM_REPO="https://github.com/ezsystems/ezplatform.git"

services:
- mysql

Expand All @@ -19,10 +20,10 @@ cache:
directories:
- $HOME/.composer/cache/files

env:
global:
# For acceptance tests
- EZPLATFORM_REPO="https://github.com/ezsystems/ezplatform.git"
branches:
only:
- master
- /^\d.\d+$/

matrix:
fast_finish: true
Expand All @@ -33,34 +34,52 @@ matrix:
env: TEST_CONFIG="phpunit.xml"
- name: '[PHP 7.1] MySQL Legacy Storage Integration'
php: 7.1
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="mysql" DATABASE="mysql://root@localhost/testdb"
env:
- TEST_CONFIG="phpunit-integration-legacy.xml"
- DB="mysql"
- DATABASE="mysql://root@localhost/testdb"
# 7.2
- name: '[PHP 7.2] Unit tests'
php: 7.2
env: TEST_CONFIG="phpunit.xml"
- name: '[PHP 7.2] PostgreSQL Legacy Storage Integration'
php: 7.2
env: TEST_CONFIG="phpunit-integration-legacy.xml" DB="postgresql" DATABASE="pgsql://postgres@localhost/testdb"
env:
- TEST_CONFIG="phpunit-integration-legacy.xml"
- DB="postgresql"
- DATABASE="pgsql://postgres@localhost/testdb"
- name: '[PHP 7.2] Solr Search Engine Integration'
php: 7.2
env: SOLR_VERSION="6.4.2" TEST_CONFIG="phpunit-integration-legacy-solr.xml" 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"
env:
- SOLR_VERSION="6.4.2"
- TEST_CONFIG="phpunit-integration-legacy-solr.xml"
- 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"
- name: '[PHP 7.2] AdminUI Behat tests'
php: 7.2
env:
- COMPOSE_FILE="doc/docker/base-dev.yml:doc/docker/selenium.yml"
- BEHAT_OPTS="--profile=adminui --suite=adminui --tags=@richtext --no-interaction -vv"
- BEHAT_OPTS="--profile=adminui --suite=richtext"
- SYMFONY_ENV=behat
- SYMFONY_DEBUG=1
# CS check
- name: 'Code Style Check'
php: 7.2
env: CHECK_CS=true

# test only master, stable branches and pull requests
branches:
only:
- master
- /^\d.\d+$/
# reduce depth (history) of git checkout
git:
depth: 30

# disable mail notifications
notifications:
email: false
slack:
rooms:
- secure: "YdZUPNm+yftOLzaaHqW8mSoDbajQa1I4KOc3cdrB/LL03E95vAIhJRJXBobvRgVdElHlIqYI/NjI6yVHRXHAWZ0du/wWkNYOBvenBRA0qEuMZaD4pl+BlylMwUKMpML72nXmcZPLDp8u9DidoaiiG4wc7h3KXu/DJC0tpSwu10A+vo1OJjToISZfteEB97OzrWSKFgfk4tXgIeyGs6EbBzpbj6Lvsk+xGaf+PAaderSFWjr7T9cx1Lc2A8E+Lu3QbI6ahdV2WxUw5B/YVvvwP8DcVS4yqyU8IZvlJpI9m5zUjFwy9puL6BiVqKAX3BXY4SoLOZcuRNIdE+Yjd0B5T0F4KWrsVgheIvAPKHoCSYlJEbBblfxLtj+1gZ06i/gn/ALP67KKcTtUzPpspF9lRoEY4IZinfhvL2hNuCgOubuham9Q+qKRk8lxRFH9WDk6EdA8rIXcN+79HrRvFJ1mcB8AkYsxRBqF2GNVrYBZui3Ksg2hXwQb1Jjakta9taBeEQOwue5GGCXJl6DpRkByPFaonGPVVAQk5PaQmvOfWGquXnTaz4xNPhnIbwMPbnn0N+DmOTmeaDuz20ngiLuD8NVy5B1GEYasDW8tTTWAcJLB2z5Mm7PDMSzaAUaaF3fvjO5b5VcJNoibxMm83akVhn1awWpw30OGbjcLd75lszY="
on_success: change
on_failure: always
on_pull_requests: false

# setup requirements for running unit/integration/behat tests
before_install:
Expand All @@ -69,15 +88,15 @@ before_install:
# Add custom php.ini configuration for test matrix
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "default_charset=UTF-8" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Prepare system
- ./bin/.travis/prepare_unittest.sh
# 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:
# Prepare system
- ./bin/.travis/prepare_unittest.sh
# 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
- travis_retry composer install --no-progress --no-interaction --prefer-dist --no-suggest
# Setup Solr / Elastic search if asked for
- if [ "${TEST_CONFIG}" = "phpunit-integration-legacy-elasticsearch.xml" ] ; then ./bin/.travis/init_elasticsearch.sh ; fi
Expand All @@ -89,18 +108,6 @@ install:
script:
- if [ "${TEST_CONFIG}" != "" ] ; then php -d date.timezone=$TEST_TIMEZONE ./vendor/bin/phpunit -c $TEST_CONFIG ; fi
- if [ "${CHECK_CS}" = "true" ] ; then ./vendor/bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating; fi
- if [ "${BEHAT_OPTS}" != "" ]; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "./bin/behat $BEHAT_OPTS" ; fi

# disable mail notifications
notifications:
email: false
slack:
rooms:
- secure: "YdZUPNm+yftOLzaaHqW8mSoDbajQa1I4KOc3cdrB/LL03E95vAIhJRJXBobvRgVdElHlIqYI/NjI6yVHRXHAWZ0du/wWkNYOBvenBRA0qEuMZaD4pl+BlylMwUKMpML72nXmcZPLDp8u9DidoaiiG4wc7h3KXu/DJC0tpSwu10A+vo1OJjToISZfteEB97OzrWSKFgfk4tXgIeyGs6EbBzpbj6Lvsk+xGaf+PAaderSFWjr7T9cx1Lc2A8E+Lu3QbI6ahdV2WxUw5B/YVvvwP8DcVS4yqyU8IZvlJpI9m5zUjFwy9puL6BiVqKAX3BXY4SoLOZcuRNIdE+Yjd0B5T0F4KWrsVgheIvAPKHoCSYlJEbBblfxLtj+1gZ06i/gn/ALP67KKcTtUzPpspF9lRoEY4IZinfhvL2hNuCgOubuham9Q+qKRk8lxRFH9WDk6EdA8rIXcN+79HrRvFJ1mcB8AkYsxRBqF2GNVrYBZui3Ksg2hXwQb1Jjakta9taBeEQOwue5GGCXJl6DpRkByPFaonGPVVAQk5PaQmvOfWGquXnTaz4xNPhnIbwMPbnn0N+DmOTmeaDuz20ngiLuD8NVy5B1GEYasDW8tTTWAcJLB2z5Mm7PDMSzaAUaaF3fvjO5b5VcJNoibxMm83akVhn1awWpw30OGbjcLd75lszY="
on_success: change
on_failure: always
on_pull_requests: false

# reduce depth (history) of git checkout
git:
depth: 30
- if [ "${BEHAT_OPTS}" != "" ]; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "./bin/ezbehat --mode=get-features --profile=adminui --tags=@richtext" ; fi
- if [ "${BEHAT_OPTS}" != "" ]; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "./bin/ezbehat --mode=get-features --profile=adminui --suite=adminui --tags=@richtext" ; fi
- if [ "${BEHAT_OPTS}" != "" ]; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "./bin/ezbehat $BEHAT_OPTS" ; fi

0 comments on commit b916c4f

Please sign in to comment.