-
Notifications
You must be signed in to change notification settings - Fork 38
/
.travis.yml
47 lines (42 loc) · 1.84 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
language: php
dist: xenial
os: linux
php:
- 7.3
- 7.4
- 8.0
services:
- mongodb
- mysql
- redis
- postgresql
addons:
apt:
packages:
- rabbitmq-server
sonarcloud:
organization: "mmucklo-github"
# 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
- pecl install mongodb; echo 'extension = mongodb.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer config "platform.ext-mongo" "1.6.16"
- COMPOSER_MEMORY_LIMIT=-1 composer require alcaeus/mongo-php-adapter
- echo 'xdebug.mode = coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- COMPOSER_MEMORY_LIMIT=-1 composer install
script:
- REDIS_HOST=localhost BEANSTALKD_HOST=localhost BEANSTALKD_PORT=11300 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 bin/ocular 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