forked from Nimut/phpunit-merger
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
160 lines (146 loc) · 3.87 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
language: php
dist: bionic
addons:
apt:
packages:
- parallel
sonarcloud:
organization: "ichhabrecht-github"
branches:
- master
- pre-merge
cache:
directories:
- $HOME/.composer/cache
- $HOME/.sonar/cache
jdk:
- oraclejdk8
sudo: required
before_install:
- echo 'xdebug.mode=coverage' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
install:
- mkdir -p .Log/coverage/ .Log/log/
- >
for COVERAGE in $COVERAGE_VERSIONS; do
echo;
echo "Installing phpunit/php-code-coverage version $COVERAGE";
echo;
echo;
git clean -Xdf;
composer require phpunit/php-code-coverage="$COVERAGE";
git checkout composer.json;
VERSION=${COVERAGE//[!0-9]/};
echo;
echo "Running phpunit";
echo;
echo;
.Build/bin/phpunit --log-junit .Log/log/junit_$VERSION.xml --coverage-php .Log/coverage/coverage_$VERSION.cov --whitelist src/ tests/;
done
script:
- >
echo;
echo "Merging log and coverage files";
echo;
echo;
bin/phpunit-merger coverage .Log/coverage/ .Log/coverage.xml;
bin/phpunit-merger log .Log/log/ .Log/junit.xml;
- >
echo;
echo "Running php lint";
echo;
echo;
find . -name \*.php ! -path "./.Build/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \;;
jobs:
fast_finish: true
include:
- stage: test
php: 8.1.0
env: COVERAGE_VERSIONS="~9.0.0 ~9.1.0 ~9.2.0"
- stage: test
php: 8.0
env: COVERAGE_VERSIONS="~9.0.0 ~9.1.0 ~9.2.0"
- stage: test
php: 7.4
env: COVERAGE_VERSIONS="~9.0.0 ~9.1.0 ~9.2.0"
- stage: test
php: 7.4
env: COVERAGE_VERSIONS="~8.0.0"
- stage: test
php: 7.4
env: COVERAGE_VERSIONS="~7.0.0"
- stage: test
php: 7.4
env: COVERAGE_VERSIONS="~6.0.0 ~6.1.0"
- stage: test
php: 7.4
env: COVERAGE_VERSIONS="~5.0.0 ~5.1.0 ~5.2.0 ~5.3.0"
- stage: test
php: 7.4
env: COVERAGE_VERSIONS="^5.0 ^6.0 ^7.0 ^8.0"
- stage: test
php: 7.3
env: COVERAGE_VERSIONS="~9.0.0 ~9.1.0 ~9.2.0"
- stage: test
php: 7.3
env: COVERAGE_VERSIONS="~8.0.0"
- stage: test
php: 7.3
env: COVERAGE_VERSIONS="~7.0.0"
- stage: test
php: 7.3
env: COVERAGE_VERSIONS="~6.0.0 ~6.1.0"
- stage: test
php: 7.3
env: COVERAGE_VERSIONS="~5.0.0 ~5.1.0 ~5.2.0 ~5.3.0"
- stage: test
php: 7.3
env: COVERAGE_VERSIONS="^5.0 ^6.0 ^7.0 ^8.0"
- stage: test
php: 7.2
env: COVERAGE_VERSIONS="~7.0.0"
- stage: test
php: 7.2
env: COVERAGE_VERSIONS="~6.0.0 ~6.1.0"
- stage: test
php: 7.2
env: COVERAGE_VERSIONS="~5.0.0 ~5.1.0 ~5.2.0 ~5.3.0"
- stage: test
php: 7.2
env: COVERAGE_VERSIONS="^5.0 ^6.0 ^7.0"
- stage: test
php: 7.1
env: COVERAGE_VERSIONS="~6.0.0 ~6.1.0"
- stage: test
php: 7.1
env: COVERAGE_VERSIONS="~5.0.0 ~5.1.0 ~5.2.0 ~5.3.0"
- stage: test
php: 7.1
env: COVERAGE_VERSIONS="^5.0 ^6.0"
- stage: test
dist: xenial
php: 7.0
env: COVERAGE_VERSIONS="~5.0.0 ~5.1.0 ~5.2.0 ~5.3.0"
- stage: test
dist: xenial
php: 7.0
env: COVERAGE_VERSIONS="^5.0"
- stage: ✔ with sonarqube scanner
if: type = push AND branch IN (master, pre-merge) AND env(SONAR_TOKEN) IS present AND fork = false
php: 7.3
env: COVERAGE_VERSIONS="~9.0.0 ~9.1.0 ~9.2.0"
before_script:
script:
- >
echo;
echo "Merging log and coverage files";
echo;
echo;
bin/phpunit-merger coverage .Log/coverage/ .Log/coverage.xml;
bin/phpunit-merger log .Log/log/ .Log/junit.xml;
- git fetch --unshallow || true
- >
echo;
echo "Running SonarQube Scanner";
echo;
echo;
sonar-scanner;