forked from pfrenssen/coder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
50 lines (45 loc) · 1.71 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
language: php
sudo: false
# Cache composer vendor directories to speed up the composer install step.
cache:
directories:
- $HOME/.composer/cache
- vendor
jobs:
fast_finish: true
include:
# Support PHP 7.0 because that is the minimum requirement of Drupal 8 core.
- php: 7.0
dist: xenial
- php: 7.1
dist: bionic
- php: 7.2
dist: bionic
- php: 7.3
dist: bionic
- php: 7.4
dist: focal
env: PHPSTAN=1
before_install:
# Speed up build time by disabling Xdebug when its not needed.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
before_script:
# We have a dedicated composer.json file for PHP 7.0 that does not have
# PHPStan because it requires >= PHP 7.1.
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then cp composer-php-7-0.json composer.json; fi
# Running composer install without a lock file will also update cached
# dependencies in vendor.
- composer install
script:
- ./vendor/bin/phpunit
# Check that the sniffs themselves follow the PHPCS coding standard.
- ./vendor/bin/phpcs -p
# Ensure that a custom standard can be invoked and the auto-loading of
# abstract classes works.
- ./vendor/bin/phpcs -p --standard=tests/Drupal/phpcs-ruleset.xml tests/Drupal/good/ --ignore=tests/Drupal/good/GoodUnitTest.php
# Ensure that the DrupalPractice standard can be invoked standalone and the
# auto-loading of abstract classes works.
- ./vendor/bin/phpcs -p --standard=coder_sniffer/DrupalPractice tests/DrupalPractice/good/ --ignore=tests/DrupalPractice/good/GoodUnitTest.php
# Only run PHPStan on the latest PHP version, no need to run it multiple
# times.
- if [[ $PHPSTAN == "1" ]]; then ./vendor/bin/phpstan analyse; fi