forked from DallasPHP/opencfp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
43 lines (34 loc) · 1.32 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
language: php
sudo: false
matrix:
fast_finish: true
include:
- php: 7.0
env: WITH_COVERAGE=true WITH_CS=true
env:
global:
- TRAVIS_DB=cfp_test
- CODECLIMATE_REPO_TOKEN=9deb249b01a414d979959cfd05a4c351b19a5959858653b20276454d4189edc3
# cache composer downloads so installing is quicker
cache:
directories:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer
before_install:
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" ]]; then COLLECT_COVERAGE=true; else COLLECT_COVERAGE=false; fi
- if [[ "$COLLECT_COVERAGE" == "false" ]]; then phpenv config-rm xdebug.ini; fi
- if [[ "$WITH_CS" == "true" ]]; then mkdir -p "$HOME/.php-cs-fixer"; fi
- composer self-update
- composer validate --no-check-publish
install:
- composer install
before_script:
- sh tools/travis/setup-mail.sh
- mysql -e "CREATE DATABASE $TRAVIS_DB" -uroot
- cp phinx.yml.dist phinx.yml
- vendor/bin/phinx migrate -e testing
script:
- if [[ "$COLLECT_COVERAGE" == "true" ]]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; else vendor/bin/phpunit; fi
- if [[ "$WITH_CS" == "true" ]]; then vendor/bin/php-cs-fixer fix --verbose --diff --dry-run; fi
after_success:
- if [[ "$COLLECT_COVERAGE" == "true" ]]; then vendor/bin/test-reporter --coverage-report build/logs/clover.xml; fi