Skip to content

Commit

Permalink
Add .travis.yml (fix #10) (WIP) (#11)
Browse files Browse the repository at this point in the history
* Add .travis.yml and improve CI (fix #10)

- Add travis badge
- Ensure fooman repository used rather than repo.magento.com
- Add beginning of 2.3 tests
- Add code sniffs (and fix bad smells)
  • Loading branch information
convenient authored Jan 28, 2019
1 parent 78fc976 commit 51fb7fe
Show file tree
Hide file tree
Showing 24 changed files with 2,517 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.idea
/vendor/
dev/instances/magento*
dev/output/actual/*
.php_cs.cache
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
language: php
php: 7.2

env:
- TEST_GROUP=21
- TEST_GROUP=22
- TEST_GROUP=23

install:
- # See https://store.fooman.co.nz/blog/no-authentication-needed-magento-2-mirror.html
- composer config --global repositories.fooman composer https://repo-magento-mirror.fooman.co.nz/
- composer install
- cd dev
- if [[ $TEST_GROUP = 21 ]]; then phpenv global 7.1; fi
- if [[ $TEST_GROUP = 21 ]]; then ./setup-magento-with-diff.sh 2.1.0 2.1.16 $TEST_GROUP; fi
- if [[ $TEST_GROUP = 22 ]]; then phpenv global 7.1; fi
- if [[ $TEST_GROUP = 22 ]]; then ./setup-magento-with-diff.sh 2.2.0 2.2.7 $TEST_GROUP; fi
- if [[ $TEST_GROUP = 23 ]]; then ./setup-magento-with-diff.sh 2.3.0 2.3.0 $TEST_GROUP; fi
- cd -

script:
- vendor/bin/php-cs-fixer fix --dry-run src/
- vendor/bin/php-cs-fixer fix --dry-run dev/TestModule
- if [[ $TEST_GROUP = 21 ]]; then vendor/bin/phpunit -c dev/phpunit/phpunit.xml --exclude-group=v22,v23 --verbose; fi
- if [[ $TEST_GROUP = 22 ]]; then vendor/bin/phpunit -c dev/phpunit/phpunit.xml --exclude-group=v21,v23 --verbose; fi
- if [[ $TEST_GROUP = 23 ]]; then vendor/bin/phpunit -c dev/phpunit/phpunit.xml --exclude-group=v21,v22 --verbose; fi

addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
- postfix

cache:
apt: true
directories:
- $HOME/.composer/cache
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Helper scripts to aid upgrading magento 2 websites

[![Build Status](https://travis-ci.org/AmpersandHQ/ampersand-magento2-upgrade-patch-helper.svg?branch=master)](https://travis-ci.org/AmpersandHQ/ampersand-magento2-upgrade-patch-helper)

This tool looks for files which have been modified as part of the upgrade and attempts to see if you have any overrides in your site. This allows you to focus in on the things that have changed and are specific to your site.

This tool checks for
Expand Down Expand Up @@ -96,10 +98,3 @@ This will output a grid of files which have overrides/preferences that need to b
| vendor/magento/module-sales/view/frontend/layout/sales_order_print.xml | app/design/frontend/Ampersand/theme/Magento_Sales/layout/sales_order_print.xml |
+------------------------------------------------------------------------+--------------------------------------------------------------------------------+
```


## Tests

Have a look in the `./dev/Makefile` to see how the tests work.

They do not run automatically in travis as you cannot run `composer create-project --repository-url=https://repo.magento.com/` without providing and exposing an access token to the world.
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
],
"require": {
"symfony/console": "^3.4",
"php": "~7.1"
"php": "~7.1|~7.2"
},
"autoload": {
"classmap": ["src/"],
"files": ["src/functions.php"]
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"friendsofphp/php-cs-fixer": "^2.14"
}
}
Loading

0 comments on commit 51fb7fe

Please sign in to comment.