Skip to content

Commit

Permalink
Merge pull request #90 from MAXakaWIZARD/pr-fix-travis-php-version
Browse files Browse the repository at this point in the history
Fix Travis PHP version detection
  • Loading branch information
gonzofy authored Aug 10, 2020
2 parents 4ae5394 + 6be2632 commit 3b4cbe8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
31 changes: 16 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ language: php

matrix:
include:
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4snapshot
env: PHP_CS_FIXER_IGNORE_ENV=1
- php: nightly
env: PHP_CS_FIXER_IGNORE_ENV=1
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4snapshot
env: PHP_CS_FIXER_IGNORE_ENV=1
- php: nightly
env: PHP_CS_FIXER_IGNORE_ENV=1
fast_finish: true

cache:
Expand All @@ -19,17 +19,18 @@ cache:
before_script:
- echo $TRAVIS_PHP_VERSION
- php -v
- PHP_VERSION=$(php -r "echo PHP_VERSION;")
- PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION ;")
- echo $PHP_VERSION
- composer install -o -q --no-suggest
- if [[ "$PHP_VERSION" == '7.3' ]]; then composer install satooshi/php-coveralls ; fi
- if [[ "$PHP_VERSION" == '7.3' ]]; then composer require satooshi/php-coveralls ; fi

script:
- make phpcs
- if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi
- mkdir -p build/logs
- if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then make test-coverage ; fi
- if [[ "$TRAVIS_PHP_VERSION" != '7.3' ]]; then make test ; fi
- if [[ "$PHP_VERSION" < '8.0' ]]; then make phpcs ; fi
- if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi
- mkdir -p build/logs
- if [[ "$PHP_VERSION" < '7.4' ]]; then make test ; fi
- if [[ "$PHP_VERSIONN" == '7.4' ]]; then make test-coverage ; fi
- if [[ "$PHP_VERSION" > '7.4' ]]; then make test-php-8 ; fi

after_script:
- if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi
- if [[ "$PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ tools/phpunit:
mv tools/phpunit-7.phar tools/phpunit
chmod +x tools/phpunit

tools/phpunit-9:
wget --directory-prefix=tools --quiet https://phar.phpunit.de/phpunit-9.phar
mv tools/phpunit-9.phar tools/phpunit
chmod +x tools/phpunit

phpcs: tools/php-cs-fixer
rm -f .php_cs.cache
composer install --optimize-autoloader --no-dev --no-suggest --quiet
tools/php-cs-fixer fix --dry-run --stop-on-violation -v

Expand All @@ -27,6 +33,10 @@ test: tools/phpunit
composer install --optimize-autoloader --no-suggest --quiet
tools/phpunit

test-php-8: tools/phpunit-9
composer install --optimize-autoloader --no-suggest --quiet
tools/phpunit

test-coverage: tools/phpunit
composer install --optimize-autoloader --no-suggest --quiet
tools/phpunit --coverage-clover build/logs/clover.xml
Expand Down

0 comments on commit 3b4cbe8

Please sign in to comment.