forked from opencfp/opencfp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
96 lines (67 loc) · 2.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
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
89
90
91
92
93
94
95
96
sudo: false
env:
global:
- TRAVIS_DB=cfp_test
- CC_TEST_REPORTER_ID=9deb249b01a414d979959cfd05a4c351b19a5959858653b20276454d4189edc3
# 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.0
before_install:
- phpenv config-rm xdebug.ini
- composer validate --no-check-publish
install:
- composer install
script:
- 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.0
before_install:
- source .travis/xdebug.sh
- xdebug-disable
- composer validate --no-check-publish
install:
- composer install
before_script:
- source .travis/code-climate.sh
- 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
- if [[ "$WITH_COVERAGE" == "true" ]]; then code-climate-before-script; fi
script:
- 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
after_success:
- if [[ "$WITH_COVERAGE" == "true" ]]; then code-climate-after-script; fi
- <<: *TEST
php: 7.1
env:
- WITH_COVERAGE=true
- <<: *TEST
php: 7.2
- stage: Asset
language: node_js
node_js: 8.8.1
install:
- yarn install
script:
- yarn run production