forked from mmucklo/DtcQueueBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
64 lines (59 loc) · 4.19 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
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
services:
- mongodb
- rabbitmq
- mysql
- redis
addons:
sonarcloud:
organization: "mmucklo-github"
branches:
- master
# beanstalkd setup from https://github.com/assaf/ironium/blob/220c112fd92ffea144b954ae4697c6b5cabe7016/.travis.yml
# (MIT Licensed - see LICENSE for MIT License information, Copyright (c) 2014 Assaf Arkin)
before_install:
- sudo apt-get update
- sudo apt-get install -y beanstalkd
- echo "START=yes" | sudo tee -a /etc/default/beanstalkd > /dev/null
- sudo service beanstalkd restart
- mysql -e 'CREATE DATABASE queue_test;'
before_script:
- composer self-update
- echo "no" | pecl install redis || true
- echo $TRAVIS_PHP_VERSION
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then extension="mongo"; echo "yes" | pecl install mongo; else extension="mongodb"; (pecl install mongodb || true); fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then phpversion=$(php --version | grep "PHP 7.0" | cut -f2 -d' '); (echo "extension=mongodb.so" > /home/travis/.phpenv/versions/$phpversion/etc/conf.d/mongodb.ini); fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]]; then phpversion=$(php --version | grep "PHP 7.1" | cut -f2 -d' '); (echo "extension=mongodb.so" > /home/travis/.phpenv/versions/$phpversion/etc/conf.d/mongodb.ini); fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then phpversion=$(php --version | grep "PHP 7.2" | cut -f2 -d' '); (echo "extension=mongodb.so" > /home/travis/.phpenv/versions/$phpversion/etc/conf.d/mongodb.ini); fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then phpversion=$(php --version | grep "PHP 7.2" | cut -f2 -d' '); (echo "extension=redis.so" > /home/travis/.phpenv/versions/$phpversion/etc/conf.d/redis.ini); fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/cache:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/framework-bundle:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/stopwatch:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/process:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/options-resolver:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/finder:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/console:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/filesystem:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/routing:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/debug:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/event-dispatcher:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/http-foundation:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/http-kernel:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/dependency-injection:3.4.4"; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then composer require "symfony/config:3.4.4"; fi
- curl --url https://getcomposer.org/composer.phar -o composer.phar && chmod a+x composer.phar
- php -d memory_limit=-1 composer.phar install
script:
- REDIS_HOST=localhost BEANSTALKD_HOST=localhost MONGODB_HOST=localhost RABBIT_MQ_HOST=localhost MYSQL_HOST=localhost MYSQL_USER=root MYSQL_DATABASE=queue_test php -d memory_limit=-1 bin/phpunit --coverage-clover=coverage.clover --log-junit=phpunit.result.xml && touch build_passed
- if [ -f build_passed ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ -f build_passed ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
- echo $(ls -l)
- echo $(pwd)
- echo $(ls -l phpunit.result.xml)
- (whichsonar=$(which sonar-scanner) && if [ -n "$whichsonar" -a "$TRAVIS_BRANCH" = "master" ]; then sonar-scanner; fi) || true