/
.travis.yml
36 lines (30 loc) · 1.07 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
language: php
sudo: false
matrix:
include:
- php: 7.1
# add variables to enable coverage, coding standard check and static analysis
env: PHPUNIT_FLAGS="--coverage-clover coverage.xml" CHECK_CS=1 RUN_PHPSTAN=1
install:
# install composer dependencies
- composer install
script:
# run tests
- vendor/bin/phpunit $PHPUNIT_FLAGS
# check coding standard (defined in composer.json "scripts" section)
- if [[ $CHECK_CS = 1 ]]; then composer check-cs; fi
# check with phpstan (defined in composer.json "scripts" section)
- if [[ $RUN_PHPSTAN = 1 ]]; then composer phpstan; fi
# run PHP_CodeSniffer with ruleset
- vendor/bin/phpcs src tests -sp --standard=src/ObjectCalisthenics/ruleset.xml --extensions=php
after_script:
# upload coverage.xml file to Coveralls to analyze it
- |
if [[ PHPUNIT_FLAGS != "" ]]; then
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
php coveralls.phar --verbose
fi
# do not send success notifications, they have no value
notifications:
email:
on_success: never