rector/.travis.yml

157 lines
4.5 KiB
YAML
Raw Normal View History

2019-11-07 00:03:11 +01:00
os: linux
2017-07-15 19:12:04 +02:00
language: php
2019-11-07 00:03:11 +01:00
php:
- '7.1'
- '7.2'
- '7.3'
- '7.4snapshot'
before_install:
# turn off XDebug
- phpenv config-rm xdebug.ini || return 0
install:
- composer install --no-progress
2019-11-07 00:25:29 +01:00
script:
- vendor/bin/phpunit --testsuite main
2019-11-07 00:03:11 +01:00
jobs:
2018-11-04 22:12:47 +01:00
include:
2019-11-07 00:03:11 +01:00
# Stage 1
-
stage: test
php: 7.1
name: Lowest dependencies
2019-11-07 00:25:29 +01:00
install:
2019-11-07 00:03:11 +01:00
# install lowest dependencies
2019-11-07 00:25:29 +01:00
- composer update --prefer-lowest --no-progress
2019-11-07 00:03:11 +01:00
-
stage: test
name: Simple checks
php: 7.1
script:
- composer docs
- php ci/check_services_in_yaml_configs.php
- php ci/run_all_sets.php
-
stage: test
name: PHPStan
php: 7.1
script:
- composer phpstan
-
stage: test
php: 7.1
name: ECS
script:
- composer check-cs
-
stage: test
name: Unit tests
2019-11-07 00:25:29 +01:00
script:
2019-11-07 00:03:11 +01:00
- vendor/bin/phpunit --testsuite main
-
stage: test
php: 7.3
name: Dog Food
2019-11-07 00:25:29 +01:00
script:
2019-11-07 00:03:11 +01:00
- composer rector
2019-11-07 00:25:29 +01:00
# Stage 2
2019-11-07 00:03:11 +01:00
-
# Run standalone install in non-root package, ref https://github.com/rectorphp/rector/issues/732
stage: standalone
php: 7.3
name: Standalone Run
script:
# 1. install locally
- mkdir test-paths
- cd test-paths
- mkdir rector-dir
- composer require rector/rector -d rector-dir
- mkdir symfony-demo-dir
- composer create-project symfony/symfony-demo symfony-demo-dir --dev
# missing for some reason
- composer require doctrine/doctrine-fixtures-bundle -d symfony-demo-dir
- composer dump-autoload --no-dev -d symfony-demo-dir
# 2. run an another project
- rector-dir/vendor/bin/rector
- cd symfony-demo-dir
- ../rector-dir/vendor/bin/rector
# --hide-autoload-errors due to skipped dev deps and mixes tests in /src
- ../rector-dir/vendor/bin/rector process src --set code-quality --hide-autoload-errors --dry-run
2019-11-07 00:25:29 +01:00
# Stage 3
2019-11-07 00:03:11 +01:00
-
stage: coverage
php: 7.3
name: Test Coverage
if: branch = master AND type = push
before_install:
- echo "keep xdebug"
script:
- vendor/bin/phpunit --coverage-clover coverage.xml
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
- php php-coveralls.phar --verbose
2019-11-07 00:25:29 +01:00
# Windows
- &STANDARD_WINDOWS_JOB
2019-11-07 00:25:29 +01:00
stage: test
name: Windows PHP 7.1
os: windows
dist: '1803-containers'
language: sh # No PHP currently
env: PHP_VERSION=7.1.32
install:
- choco install php --version=${PHP_VERSION} --package-parameters="/InstallDir:c:\tools\php"
- choco install composer --ia "/DEV=C:\tools\php"
- echo 'memory_limit=1G' >> 'C:\tools\php\php.ini'
- echo 'date.timezone="UTC"' >> 'C:\tools\php\php.ini'
- echo 'extension_dir=ext' >> 'C:\tools\php\php.ini'
- echo 'extension=php_mbstring.dll' >> 'C:\tools\php\php.ini'
- echo 'extension=php_openssl.dll' >> 'C:\tools\php\php.ini'
- echo 'extension=php_mysqli.dll' >> 'C:\tools\php\php.ini'
- echo 'extension=php_intl.dll' >> 'C:\tools\php\php.ini'
2019-11-07 00:25:29 +01:00
- export PATH=/c/tools/php:$PATH
2019-11-07 00:52:19 +01:00
script:
# @todo this is probably broken, needs fixing
- php vendor/phpunit/phpunit/phpunit
2019-11-07 00:25:29 +01:00
-
<<: *STANDARD_WINDOWS_JOB
2019-11-07 00:25:29 +01:00
name: Windows PHP 7.2
env: PHP_VERSION=7.2.23
-
<<: *STANDARD_WINDOWS_JOB
2019-11-07 00:25:29 +01:00
name: Windows PHP 7.3
env: PHP_VERSION=7.3.10
2018-11-04 23:58:54 +01:00
allow_failures:
2019-11-07 00:03:11 +01:00
- name: ECS
- name: Standalone Run
2019-11-07 00:25:29 +01:00
- os: windows
2017-07-15 19:12:04 +02:00
2019-11-07 00:03:11 +01:00
matrix:
fast_finish: true
2018-10-28 18:02:30 +01:00
cache:
2018-11-04 22:12:47 +01:00
directories:
- $HOME/.composer/cache
2019-11-07 00:25:29 +01:00
- tmp
2017-07-15 19:12:04 +02:00
notifications:
2018-11-04 22:12:47 +01:00
email: false