Skip to content

Commit

Permalink
WIP: Travis configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkhansrc committed Feb 3, 2022
1 parent f57c631 commit 09622d6
Showing 1 changed file with 14 additions and 27 deletions.
41 changes: 14 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,28 @@ sudo: false
cache:
directories:
- $HOME/.composer/cache/files
- vendor/bin/simple-phpunit

- $HOME/symfony-bridge/.phpunit
env:
global:
- SYMFONY_PHPUNIT_DIR=./bin/.phpunit
- SYMFONY_DEPRECATIONS_HELPER=9
- ACTION="install"
- PHPUNIT_FLAGS="-v"
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"

matrix:
fast_finish: true
include:
- php: 7.4
env: SYMFONY="4.4.*"
ACTION="update"

before_install:
- '[[ "$TRAVIS_PHP_VERSION" == "7.4snapshot" ]] || phpenv config-rm xdebug.ini'
- composer self-update
# Set memory to max (memory fail)
- '[[ "$ACTION" == "install" ]] || echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini'
# Set stability to dev to allow 4.4dev and 5.0dev
- '[[ "$ACTION" == "install" ]] || composer config minimum-stability dev'
# Change version of symfony when need
- '[[ "$ACTION" == "install" ]] || composer config extra.symfony.require $SYMFONY'

- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
install:
- php -r "echo ini_get('memory_limit').PHP_EOL;"
# install or update
- composer $ACTION
- ./vendor/bin/simple-phpunit

# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
- ./vendor/bin/simple-phpunit install
script:
- ./vendor/bin/simple-phpunit
# this checks that the source code follows the Symfony Code Syntax rules
- '[[ "$TRAVIS_PHP_VERSION" == "7.4" ]] || ./vendor/bin/php-cs-fixer fix --diff --dry-run -v'
# Fail CI if the repo is in a dirty state after building assets (only for current release ie install)
#- if [[ "$ACTION" == "install" ]]; then yarn install && yarn encore production && git add --all && git diff --staged --exit-code; fi
- composer validate
- composer validate --strict --no-check-lock
# simple-phpunit is the PHPUnit wrapper provided by the PHPUnit Bridge component and
# it helps with testing legacy code and deprecations (composer require symfony/phpunit-bridge)
- ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS

0 comments on commit 09622d6

Please sign in to comment.