forked from mglaman/phpstan-drupal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (35 loc) · 1.82 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
language: php
php:
- "7.2"
- "7.3"
- "7.4"
before_install: []
install:
- composer install --no-interaction
- COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal-composer/drupal-project:8.x-dev $TRAVIS_BUILD_DIR/../drupal --no-interaction --no-progress
before_script:
- if php --ri xdebug >/dev/null; then phpenv config-rm xdebug.ini; fi
script:
# Inspections
- ./vendor/bin/phpcs src
- ./vendor/bin/phpstan analyze src
- ./vendor/bin/phpunit
# Install package to a Drupal project. Use repository key 1 to not override Drupal's packagist endpoint.
- cd $TRAVIS_BUILD_DIR/../drupal
- composer config repositories.1 path $TRAVIS_BUILD_DIR
- COMPOSER_MEMORY_LIMIT=-1 composer require mglaman/phpstan-drupal *@dev
- cp $TRAVIS_BUILD_DIR/tests/fixtures/config/drupal-phpstan.neon phpstan.neon
# Test that a known non-failing file doesn't error out.
- ./vendor/bin/phpstan analyze web/core/install.php --debug
- ./vendor/bin/phpstan analyze web/core/modules/dynamic_page_cache | grep -q "Class Drupal\Tests\BrowserTestBase not found and could not be autoloaded." && false || true
# Verify test fixtures are ignored.
- ./vendor/bin/phpstan analyze web/core/modules/migrate_drupal --no-progress | grep -q "tests/fixtures" && false || true
# Check "Cannot redeclare token_theme() due to blazy_test.module"
- COMPOSER_MEMORY_LIMIT=-1 composer require drupal/token drupal/blazy
- ./vendor/bin/phpstan analyze web/modules/contrib/blazy --no-progress || if (($? == 255)); then false; else true; fi
# Check " Cannot redeclare video_embed_media_media_bundle_insert() due to slick_test.module"
- composer require drupal/video_embed_field drupal/slick
- ./vendor/bin/phpstan analyze web/modules/contrib/slick --no-progress || if (($? == 255)); then false; else true; fi
cache:
directories:
- $HOME/.composer/cache