-
Notifications
You must be signed in to change notification settings - Fork 59
/
.travis.yml
62 lines (51 loc) · 2.1 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
env:
global:
- CC_TEST_REPORTER_ID=746515d1c23be6dd2156392b8113586efad4e99606da2e2d17a6bafbda7ae355
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
sudo: required
language: php
php:
- 5.6
- 7.0
- 7.1
- nightly
matrix:
include:
- php: 7.2
env: COVERAGE=yes
- php: 7.2
env: EXECUTE_CS_CHECK=yes
fast_finish: true
allow_failures:
- php: nightly
- php: 7.2
env: EXECUTE_CS_CHECK=yes
services:
- docker
cache:
directories:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer
before_install:
- docker run -d --name="teamspeak_server" -p "9987:9987/udp" -p 10011:10011 -p 30033:30033 teamspeak:latest
- docker ps -a
- docker logs teamspeak_server
- if [[ $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PHP_VERSION != nightly && $COVERAGE != yes ]]; then phpenv config-rm xdebug.ini; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable_cli=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- travis_retry composer self-update
install:
- travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction
before_script:
- mkdir -p "$HOME/.php-cs-fixer"
- cp phpunit.xml.dist phpunit.xml
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- composer validate
- if [[ $COVERAGE == yes ]]; then vendor/bin/phpunit --coverage-text; else vendor/bin/phpunit --no-coverage; fi
- if [[ $EXECUTE_CS_CHECK == yes ]]; then php -n -d memory_limit=768M vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --dry-run; fi
- if [[ $COVERAGE == yes ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
after_success:
- travis_retry php vendor/bin/php-coveralls -v