rector/.travis.yml

163 lines
5.4 KiB
YAML
Raw Normal View History

2019-11-07 00:03:11 +01:00
os: linux
2019-12-09 01:18:28 +01:00
dist: bionic
2017-07-15 19:12:04 +02:00
language: php
2019-11-07 00:03:11 +01:00
php:
- '7.3'
2019-12-15 22:45:12 +02:00
- '7.4'
2019-11-07 00:03:11 +01:00
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-12-27 18:55:58 +01:00
stages:
- test
2019-12-27 19:57:46 +01:00
- compile
2019-12-27 18:55:58 +01:00
- name: phar
if: (branch = master OR tag IS present) && type = push
2019-12-28 11:13:43 +01:00
- coverage
2019-12-27 18:55:58 +01:00
2019-11-07 00:03:11 +01:00
jobs:
2018-11-04 22:12:47 +01:00
include:
-
stage: compile
name: "Compile Rector to prefixed PHAR"
2019-12-01 17:59:30 +01:00
php: 7.2
script:
- cd compiler
- composer install
- bin/compile
- ../tmp/rector.phar
2019-12-01 17:59:30 +01:00
# inspired by https://github.com/phpstan/phpstan-src/blob/088b9fab470632cea07f08a936fb0923a59b2ecb/.travis.yml#L47-L59
-
stage: phar
name: "Deploy PHAR to https://github.com/rectorphp/rector-prefixed"
php: 7.2
script:
2019-12-09 01:18:28 +01:00
# reuse tmp/rector.phar from previous job
2019-12-01 17:59:30 +01:00
- git clone https://${GITHUB_TOKEN}@github.com/rectorphp/rector-prefixed.git rector-prefixed > /dev/null 2>&1
2019-12-09 01:18:28 +01:00
- cp tmp/rector.phar rector-prefixed/rector.phar
- cp tmp/rector.phar rector-prefixed/rector
2019-12-01 17:59:30 +01:00
- cd rector-prefixed
- git config user.email "travis@travis-ci.org"
- git config user.name "Travis CI"
- git add rector rector.phar
2019-12-28 11:13:43 +01:00
- if [ "${TRAVIS_TAG}" != "" ]; then COMMIT_MSG="Rector ${TRAVIS_TAG}"; else COMMIT_MSG="Updated Rector to commit ${TRAVIS_COMMIT}"; fi
2019-12-28 14:25:20 +01:00
- git commit -m "${COMMIT_MSG}"
2019-12-01 17:59:30 +01:00
- git push --quiet origin master
2020-01-04 18:48:39 +01:00
- if [ "${TRAVIS_TAG}" != "" ]; then git tag -m "${TRAVIS_TAG}" && git push --quiet origin ${TRAVIS_TAG}; fi
2019-11-07 00:03:11 +01:00
# Stage 1
-
stage: test
2019-11-23 18:56:27 +01:00
php: 7.2
2019-12-28 11:13:43 +01:00
name: "PHP: 7.2 with 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
2019-11-14 00:53:03 +01:00
-
name: Documentation
2019-11-23 18:56:27 +01:00
php: 7.2
2019-11-14 00:53:03 +01:00
script:
- composer check-docs
-
name: Simple checks
2019-11-23 18:56:27 +01:00
php: 7.2
2019-11-14 00:53:03 +01:00
script:
- php ci/check_services_in_yaml_configs.php
- php ci/run_all_sets.php
2019-11-07 00:03:11 +01:00
-
# Run standalone install in non-root package, ref https://github.com/rectorphp/rector/issues/732
2019-12-27 18:53:29 +01:00
stage: test
2019-11-07 00:03:11 +01:00
php: 7.3
name: Standalone Run
script:
# 1. install locally
- mkdir test-paths
- cd test-paths
- mkdir rector-dir
2020-01-06 16:49:16 +01:00
- composer require rector/rector:@dev -d rector-dir
2019-11-07 00:03:11 +01:00
- 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-12-27 18:53:29 +01:00
# Stage 2
2019-11-07 00:03:11 +01:00
-
stage: test
2019-11-07 00:03:11 +01:00
php: 7.3
name: Test Coverage
script:
2020-01-06 14:28:15 +01:00
- phpdbg -qrr -d memory_limit=-1 vendor/bin/phpunit --coverage-clover coverage.xml
2019-11-07 00:03:11 +01:00
- 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
# skip for now, doesn't work, so it only slows down travis
# - &STANDARD_WINDOWS_JOB
# stage: skipped
# name: Windows PHP 7.2
# os: windows
# dist: '1803-containers'
# language: sh # No PHP currently
# env: PHP_VERSION=7.2.23
# 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'
# - export PATH=/c/tools/php:$PATH
# script:
# # @todo this is probably broken, needs fixing
# - php vendor/bin/phpunit
#
# -
# <<: *STANDARD_WINDOWS_JOB
# name: Windows PHP 7.3
# env: PHP_VERSION=7.3.10
2019-11-07 00:25:29 +01:00
2018-11-04 23:58:54 +01:00
allow_failures:
2019-11-07 00:03:11 +01:00
- name: ECS
- name: Rector
2019-11-07 00:03:11 +01:00
- name: Standalone Run
2019-11-14 00:53:03 +01:00
- name: Documentation
2019-11-07 00:25:29 +01:00
- os: windows
2017-07-15 19:12:04 +02: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