Skip to content

Commit 7a746ca

Browse files
committed
Test lowest PHP7 dependencies with travis.
Make use of composer scripts to start tests. Remove code sniffer and use php-parallel-lint instead.
1 parent 5726db9 commit 7a746ca

File tree

3 files changed

+73
-95
lines changed

3 files changed

+73
-95
lines changed

.travis.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ cache:
1313
directories:
1414
- $HOME/.composer/cache
1515

16-
php:
17-
- 7.0
18-
- nightly
19-
2016
matrix:
17+
include:
18+
- php: 7
19+
env: cov=1
20+
- php: 7
21+
env: deps=low
22+
- php: nightly
2123
allow_failures:
2224
- php: nightly
2325
fast_finish: true
@@ -30,21 +32,18 @@ git:
3032
depth: 1
3133

3234
install:
33-
- travis_retry composer install --prefer-dist --no-interaction
35+
- if [ "$deps" == "low" ]; then travis_retry composer update --prefer-source --prefer-lowest --prefer-stable --no-interaction; fi
36+
- if [ "$deps" != "low" ]; then travis_retry composer install --prefer-source --no-interaction; fi
3437

3538
before_script:
3639
- mysql -u root -e 'create database telegrambot; use telegrambot; source ./vendor/longman/telegram-bot/structure.sql;'
3740

3841
script:
39-
- |
40-
if [[ "$TRAVIS_PHP_VERSION" == "7.0" ]] ; then
41-
./vendor/bin/phpunit --coverage-clover=coverage.xml
42-
else
43-
./vendor/bin/phpunit
44-
fi
42+
- if [[ "$cov" == "1" ]] ; then composer test-cov; fi
43+
- if [[ "$cov" != "1" ]] ; then composer test; fi
4544

4645
after_success:
47-
- if [[ "$TRAVIS_PHP_VERSION" == "7.0" ]]; then bash <(curl -s https://codecov.io/bash); fi
46+
- if [[ "$cov" == "1" ]]; then bash <(curl -s https://codecov.io/bash); fi
4847

4948
env:
5049
global:

composer.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"php": "^7.0",
2222
"longman/telegram-bot": "^0.35"
2323
},
24+
"require-dev": {
25+
"phpunit/phpunit": "^5.5",
26+
"jakub-onderka/php-parallel-lint": "^0.9"
27+
},
2428
"autoload": {
2529
"psr-4": {
2630
"NPM\\TelegramBotManager\\": "src"
@@ -31,8 +35,14 @@
3135
"NPM\\TelegramBotManager\\Tests\\": "tests/TelegramBotManager/Tests"
3236
}
3337
},
34-
"require-dev": {
35-
"phpunit/phpunit": "^5.5",
36-
"squizlabs/php_codesniffer": "^2.7"
38+
"scripts": {
39+
"test": [
40+
"parallel-lint . --exclude vendor",
41+
"phpunit"
42+
],
43+
"test-cov": [
44+
"parallel-lint . --exclude vendor",
45+
"phpunit --coverage-clover=coverage.xml"
46+
]
3747
}
3848
}

composer.lock

Lines changed: 49 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)