forked from opencfp/opencfp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
88 lines (62 loc) · 2.15 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
sudo: false
env:
global:
- TRAVIS_DB=cfp_test
# cache composer downloads so installing is quicker
cache:
yarn: true
directories:
- $HOME/.composer/cache
stages:
- style
- test
- asset
jobs:
include:
- stage: Style
language: php
php: 7.1
before_install:
- phpenv config-rm xdebug.ini
- composer validate --no-check-publish
install:
- composer install
script:
- composer normalize --dry-run
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then COMMIT_RANGE=$TRAVIS_COMMIT_RANGE; else COMMIT_RANGE="HEAD~..HEAD"; fi;
- CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}")
- if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then IFS=$'\n' EXTRA_ARGS=('--path-mode=intersection' '--' ${CHANGED_FILES[@]}); fi
- vendor/bin/php-cs-fixer fix --config=.php_cs.dist --dry-run --diff -v --using-cache=no "${EXTRA_ARGS[@]}"
- &TEST
stage: Test
language: php
php: 7.1
before_install:
- source .travis/xdebug.sh
- xdebug-disable
- composer validate --no-check-publish
install:
- composer install
before_script:
- sh .travis/setup-mail.sh
- mysql -e "CREATE DATABASE $TRAVIS_DB" -uroot
- cp config/testing.yml.dist config/testing.yml
- CFP_ENV=testing vendor/bin/phinx migrate --environment testing
- mysqldump -uroot $TRAVIS_DB > tests/dump.sql
script:
- vendor/bin/phpunit --testsuite auto-review
- vendor/bin/phpunit --testsuite integration
- if [[ "$WITH_COVERAGE" == "true" ]]; then xdebug-enable; fi
- if [[ "$WITH_COVERAGE" == "true" ]]; then vendor/bin/phpunit --testsuite unit --coverage-clover build/logs/clover.xml; else vendor/bin/phpunit --testsuite unit; fi
- if [[ "$WITH_COVERAGE" == "true" ]]; then xdebug-disable; fi
- <<: *TEST
php: 7.2
env:
- WITH_COVERAGE=true
- stage: Asset
language: node_js
node_js: 8.8.1
install:
- yarn install
script:
- yarn run production