forked from unite-cms/unite-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
112 lines (100 loc) · 3.26 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
language: php
sudo: false
dist: xenial
os: linux
cache:
directories:
# - vendor
- coverage
- $HOME/.composer/cache/files
addons:
apt:
sources:
- mysql-5.7-xenial
packages:
- mysql-server
services:
- mysql
env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak
jobs:
include:
- php: 7.1
if: (type == push AND fork = false) OR (type == pull_request AND fork = true)
env:
- PHPUNIT_CONF=phpunit.xml.dist
- php: 7.2
if: (type == push AND fork = false) OR (type == pull_request AND fork = true)
env:
- PHPUNIT_CONF=phpunit_parameter.xml.dist
- php: 7.2
if: (type == push AND fork = false) OR (type == pull_request AND fork = true)
env:
- PHPUNIT_CONF=phpunit_subdomain.xml.dist
- php: 7.2
if: type == push AND branch = master AND fork = false
env:
- PHPUNIT_CONF=phpunit.xml.dist
- COVERAGE_FILTER='UniteCMS\\CoreBundle\\Tests'
- COVERAGE_ID=1
- CMD_APPEND=' --exclude-group=slow'
- php: 7.2
if: type == push AND branch = master AND fork = false
env:
- PHPUNIT_CONF=phpunit.xml.dist
- COVERAGE_FILTER='UniteCMS\\CoreBundle\\Tests'
- COVERAGE_ID=2
- CMD_APPEND=' --group=slow'
- php: 7.2
if: type == push AND branch = master AND fork = false
env:
- PHPUNIT_CONF=phpunit.xml.dist
- COVERAGE_FILTER='UniteCMS\\(CollectionField|Registration|Storage|VariantsField|WysiwygField)Bundle\\Tests'
- COVERAGE_ID=3
- CMD_APPEND=
- stage: submit
if: type == push AND branch = master AND fork = false
addons:
services:
php: 7.2
env:
- JOB_COUNT_COVERAGE=3 # 3 jobs are generating coverage reports
script:
- echo "do not run script"
after_script:
- s3cmd sync "s3://$S3_BUCKET/coverage/" coverage/ --secret_key=$S3_SECRET_KEY --access_key=$S3_ACCESS_KEY --host=$S3_HOST --host-bucket=$S3_HOST --force
- ./cc-test-reporter sum-coverage --output - --parts $JOB_COUNT_COVERAGE coverage/clover.*.xml | ./cc-test-reporter upload-coverage --input -
after_success:
- echo "do not after success"
before_install:
- |
if ! [[ $COVERAGE_FILTER ]]; then
phpenv config-rm xdebug.ini
fi
composer self-update
mysql -e 'CREATE DATABASE unite_test;'
cp .env.dist .env
install:
- sudo apt-get install -y awscli s3cmd
- 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
script:
- |
if [[ $COVERAGE_FILTER ]]; then
./vendor/phpunit/phpunit/phpunit --configuration $PHPUNIT_CONF --coverage-clover clover.xml --filter $COVERAGE_FILTER $CMD_APPEND
else
./vendor/phpunit/phpunit/phpunit --configuration $PHPUNIT_CONF
fi
after_success:
- |
if [[ $COVERAGE_FILTER ]]; then
if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then
./cc-test-reporter format-coverage -t clover -o coverage/clover.$COVERAGE_ID.xml clover.xml
s3cmd sync coverage/ "s3://$S3_BUCKET/coverage/" --secret_key=$S3_SECRET_KEY --access_key=$S3_ACCESS_KEY --host=$S3_HOST --host-bucket=$S3_HOST --force
fi
fi