forked from squizlabs/PHP_CodeSniffer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
116 lines (109 loc) · 4.07 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
os: linux
dist: xenial
language: php
jobs:
fast_finish: true
include:
#############################################
# Builds using the default test script.
#############################################
- php: 5.4
dist: trusty
- php: 5.5
dist: trusty
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: 8.0
# Nightly is PHP 8.1 since Oct 2020.
- php: nightly
addons:
apt:
packages:
- libonig-dev
#############################################
# Builds which don't use the default test script.
#############################################
# Builds running the basic tests with different PHP ini settings.
- php: 5.5
name: "PHP: 5.5 | Unit tests with custom PHP ini"
dist: trusty
before_script:
- phpenv config-add php5-testingConfig.ini
script:
- php bin/phpcs --config-set php_path php
- vendor/bin/phpunit tests/AllTests.php
- php: 7.0
name: "PHP: 7.4 | Unit tests with custom PHP ini"
before_script:
- phpenv config-add php7-testingConfig.ini
script:
- php bin/phpcs --config-set php_path php
- vendor/bin/phpunit tests/AllTests.php
# Build running just the PEAR package file and XML file validation and code style check.
- php: 7.4
name: "PHP: 7.4 | Pear + XML validate"
addons:
apt:
packages:
- libxml2-utils
before_install:
- export XMLLINT_INDENT=" "
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
install:
- curl -O https://www.w3.org/2012/04/XMLSchema.xsd
script:
# Validate the Pear Package file contents.
- php scripts/validate-pear-package.php
# Validate the xml ruleset files.
# @link http://xmlsoft.org/xmllint.html
- xmllint --noout --schema phpcs.xsd ./src/Standards/*/ruleset.xml
- xmllint --noout --schema ./XMLSchema.xsd ./phpcs.xsd
# Check the code-style consistency of the xml files.
- diff -B ./phpcs.xml.dist <(xmllint --format "./phpcs.xml.dist")
- diff -B ./src/Standards/Generic/ruleset.xml <(xmllint --format "./src/Standards/Generic/ruleset.xml")
- diff -B ./src/Standards/MySource/ruleset.xml <(xmllint --format "./src/Standards/MySource/ruleset.xml")
- diff -B ./src/Standards/PEAR/ruleset.xml <(xmllint --format "./src/Standards/PEAR/ruleset.xml")
- diff -B ./src/Standards/PSR1/ruleset.xml <(xmllint --format "./src/Standards/PSR1/ruleset.xml")
- diff -B ./src/Standards/PSR2/ruleset.xml <(xmllint --format "./src/Standards/PSR2/ruleset.xml")
- diff -B ./src/Standards/PSR12/ruleset.xml <(xmllint --format "./src/Standards/PSR12/ruleset.xml")
- diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml")
- diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml")
# Build running just and only PHPStan.
- php: 7.4
name: "PHP: 7.4 | PHPStan"
env: PHPSTAN=1
addons:
apt:
packages:
- libonig-dev
before_install:
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
script:
- composer require --dev phpstan/phpstan
- php vendor/bin/phpstan analyse --configuration=phpstan.neon
allow_failures:
- php: 7.4
env: PHPSTAN=1
- php: nightly
before_install:
# Speed up build time by disabling Xdebug when its not needed.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
- |
if [[ $TRAVIS_PHP_VERSION == "nightly" || $TRAVIS_PHP_VERSION == "8.0" ]]; then
// Allow installing "incompatible" PHPUnit version on PHP 8/nightly.
travis_retry composer install --ignore-platform-reqs
else
travis_retry composer install
fi
script:
- php bin/phpcs --config-set php_path php
- vendor/bin/phpunit tests/AllTests.php
- php bin/phpcs --no-cache --parallel=1
- pear package-validate package.xml
- composer validate --no-check-all --strict
- php scripts/build-phar.php
- php phpcs.phar