forked from Nimut/phpunit-merger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
98 lines (84 loc) · 2.27 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
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:
- >
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;
mkdir -p .Log/coverage/ .Log/log/;
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 --coverage-filter 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="~10.0.0 ~10.1.0"
- 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: ✔ with sonarqube scanner
if: type = push AND branch IN (master, pre-merge) AND env(SONAR_TOKEN) IS present AND fork = false
php: 8.1
env: COVERAGE_VERSIONS="~10.0.0 ~10.1.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;