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:
|
2020-01-09 13:20:14 +01:00
|
|
|
# 7.2 is covered in minimal dependencies
|
2019-11-07 00:03:11 +01:00
|
|
|
- '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
|
2020-01-09 13:20:14 +01:00
|
|
|
- phpenv config-rm xdebug.ini
|
2019-11-07 00:03:11 +01:00
|
|
|
|
|
|
|
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
|
2020-01-09 13:20:14 +01:00
|
|
|
- name: compile
|
|
|
|
if: (branch = master OR tag IS present) && type = push
|
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:
|
2019-12-08 18:01:29 +01:00
|
|
|
-
|
|
|
|
stage: compile
|
|
|
|
name: "Compile Rector to prefixed PHAR"
|
2019-12-01 17:59:30 +01:00
|
|
|
php: 7.2
|
|
|
|
script:
|
2019-12-08 18:01:29 +01:00
|
|
|
- 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
|
2020-01-11 01:14:03 +01:00
|
|
|
- git config user.name "TomasVotruba"
|
|
|
|
- git config user.email "tomas.vot@gmail.com"
|
2019-12-01 17:59:30 +01:00
|
|
|
- git add rector rector.phar
|
2019-12-27 18:59:23 +01:00
|
|
|
|
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-27 18:59:23 +01:00
|
|
|
|
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-07 13:21:03 +01:00
|
|
|
- if [ "${TRAVIS_TAG}" != "" ]; then git tag "${TRAVIS_TAG}" && git push --quiet origin ${TRAVIS_TAG}; fi
|
2019-12-27 18:59:23 +01:00
|
|
|
|
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
|
2020-01-09 13:19:48 +01:00
|
|
|
|
2020-01-09 13:20:14 +01:00
|
|
|
-
|
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
|
|
|
-
|
2020-01-06 09:59:22 +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
|
2020-01-09 13:20:14 +01:00
|
|
|
# Coveralls.io
|
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
|
|
|
|
|
2018-11-04 23:58:54 +01:00
|
|
|
allow_failures:
|
2019-11-07 00:03:11 +01:00
|
|
|
- name: Standalone Run
|
2017-07-15 19:12:04 +02:00
|
|
|
|
2017-11-05 22:23:02 +01:00
|
|
|
cache:
|
2018-11-04 22:12:47 +01:00
|
|
|
directories:
|
2020-01-09 13:20:14 +01:00
|
|
|
- $HOME/.composer/cache
|
2019-11-07 00:25:29 +01:00
|
|
|
- tmp
|
2017-11-05 22:23:02 +01:00
|
|
|
|
2017-07-15 19:12:04 +02:00
|
|
|
notifications:
|
2018-11-04 22:12:47 +01:00
|
|
|
email: false
|