-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (34 loc) · 1.4 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
env:
global:
- CC_TEST_REPORTER_ID=141be9862dc0f3388f8d4e3c9de84ad880bdceb42cab4e0ab46373750638e00c
- 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)
language: php
php:
- 7.0
- 7.1
sudo: false
matrix:
fast_finish: true
include:
- php: 7.0
env: PHPSTAN=1 DEFAULT=0
# - php: 7.1
# env: PHPSTAN=1 DEFAULT=1
install:
- composer self-update
- composer install
before_script:
- 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
- if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.9; fi
script:
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml; fi
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 4 src; fi
after_script:
- CODECLIMATE_REPO_TOKEN="141be9862dc0f3388f8d4e3c9de84ad880bdceb42cab4e0ab46373750638e00c" vendor/bin/test-reporter --stdout > codeclimate.json
- "sh -c 'curl -X POST -d @codeclimate.json -H \"Content-Type: application/json\" -H \"User-Agent: Code Climate (PHP Test Reporter v0.1.1)\" https://codeclimate.com/test_reports ; fi'"
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
email: false