forked from mmucklo/DtcQueueBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
44 lines (39 loc) · 1.79 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
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
- (php -m | grep 'redis') || echo "extension = redis.so" > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/redis.ini
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then echo 'no' | pecl install mongo; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then pecl install mongodb; composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter; fi
- COMPOSER_MEMORY_LIMIT=-1 composer 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