# See https://github.com/silverstripe/silverstripe-travis-support for setup details

sudo: false

language: php

matrix:
  include:
    - php: 5.6
      env: DB=MYSQL CORE_RELEASE=3.5 PHPUNIT_TEST=1 PHPCS_TEST=1
    - php: 5.6
      env: DB=MYSQL CORE_RELEASE=3.6 PHPUNIT_TEST=1
    - php: 7.0
      env: DB=PGSQL CORE_RELEASE=3 PHPUNIT_TEST=1
    - php: 7.1
      env: DB=PGSQL CORE_RELEASE=3 PHPUNIT_TEST=1
    - php: 7.2
      env: DB=MYSQL CORE_RELEASE=3 PHPUNIT_TEST=1

before_script:
  # Init PHP
  - phpenv rehash
  - phpenv config-rm xdebug.ini

  # Update and validate composer configuration
  - composer self-update || true
  - composer clear-cache
  - composer validate --strict

  - git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
  - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require bringyourownideas/silverstripe-composer-versions
  - cd ~/builds/ss
  - composer install

script:
  - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit silverstripe-maintenance/tests; fi
  - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/ *.php; fi

# See https://github.com/silverstripe/silverstripe-travis-support for setup details

sudo: false

language: php

matrix:
  include:
    - php: 5.6
      env: DB=MYSQL CORE_RELEASE=3.5 PHPUNIT_TEST=1 PHPCS_TEST=1
    - php: 5.6
      env: DB=MYSQL CORE_RELEASE=3.6 PHPUNIT_TEST=1
    - php: 7.0
      env: DB=PGSQL CORE_RELEASE=3 PHPUNIT_TEST=1
    - php: 7.1
      env: DB=PGSQL CORE_RELEASE=3 PHPUNIT_TEST=1
    - php: 7.2
      env: DB=MYSQL CORE_RELEASE=3 PHPUNIT_TEST=1

before_script:
  # Init PHP
  - phpenv rehash
  - phpenv config-rm xdebug.ini

  # Update and validate composer configuration
  - composer self-update || true
  - composer clear-cache
  - composer validate --strict

  - git clone git://github.com/silverstripe/silverstripe-travis-support.git ~/travis-support
  - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss --require bringyourownideas/silverstripe-composer-versions
  - cd ~/builds/ss
  - composer install

script:
  - if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit silverstripe-maintenance/tests; fi
  - if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs silverstripe-maintenance/src/ silverstripe-maintenance/tests/; fi

Update path for SS3 Travis project structure in PHPCS linting command
Update path for SS3 Travis project structure in PHPCS linting command
