I've some modules to Magento 2.0 and 2.1, so I'd like to implement the Travis CLI to install the Magento and test my extension in some Magento versions and PHP versions, how can I do that?
Thanks
I've some modules to Magento 2.0 and 2.1, so I'd like to implement the Travis CLI to install the Magento and test my extension in some Magento versions and PHP versions, how can I do that?
Thanks
You can create your file .travis.yml like that example:
dist: trusty
language: php
php:
- 5.6
- 7.0
env:
- TEST_SUITE=unit
- TEST_SUITE=phpcs
- TEST_SUITE=marketplaceeqp
before_script:
- sleep 60
script:
- wget https://github.com/magento/magento2/archive/2.0.2.zip
- unzip -qq 2.0.2.zip
- cd magento2-2.0.2/
- wget https://gist.githubusercontent.com/centerax/5e42abec89d62a1308ba/raw/4b3242361c0690e234266afb3520c2940ac1055a/auth.json
- composer require --prefer-source --no-interaction ebizmarts/magento2-magemonkey:dev-develop
- sh -c "if [ '$TEST_SUITE' = 'unit' ]; then /bin/cp ../phpunit_config.xml dev/tests/unit/ && ./vendor/bin/phpunit -c dev/tests/unit/phpunit_config.xml --coverage-text; fi"
- sh -c "if [ '$TEST_SUITE' = 'phpcs' ]; then composer require --prefer-source --no-interaction "squizlabs/php_codesniffer=*" magento-ecg/coding-standard && vendor/squizlabs/php_codesniffer/scripts/phpcs --config-set installed_paths vendor/magento-ecg/coding-standard && ./vendor/squizlabs/php_codesniffer/scripts/phpcs -n --standard="EcgM2" ./vendor/ebizmarts/magento2-magemonkey/; fi"
- sh -c "if [ '$TEST_SUITE' = 'marketplaceeqp' ]; then composer require --prefer-source --no-interaction squizlabs/php_codesniffer magento/marketplace-eqp && vendor/squizlabs/php_codesniffer/scripts/phpcs --config-set installed_paths vendor/magento/marketplace-eqp && ./vendor/squizlabs/php_codesniffer/scripts/phpcs -n --standard="MEQP2" ./vendor/ebizmarts/magento2-magemonkey/; fi"