Skip to content

Commit

Permalink
Merge pull request #24 from mickaelandrieu/add-travis-build
Browse files Browse the repository at this point in the history
Added travis + tests + cs fixes
  • Loading branch information
matks committed Oct 18, 2018
2 parents 17258a0 + fba3925 commit 6756078
Show file tree
Hide file tree
Showing 17 changed files with 2,911 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
data/data_*
views/css/advice-*
vendor/
.php_cs.cache
55 changes: 55 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
language: php

addons:
apt:
packages:
- apache2
- postfix
- libapache2-mod-fastcgi
- libappindicator1
- fonts-liberation

cache:
directories:
- $HOME/.composer/cache

sudo: required
dist: trusty

php:
- "5.6"
- "7.1"
- "7.2"

env:
global:
- SYMFONY_DEPRECATIONS_HELPER=disabled
- SYMFONY_PHPUNIT_VERSION=5.7
- MODULE_DIR=/tmp/gamification
- MODULE_SCRIPTS_DIR=/tmp/gamification/tools

matrix:
- PS_VERSION=1.7.4.x
- PS_VERSION=1.7.5.x

allow_failures:
- php: 7.2

fast_finish: true

before_script:
- ./tools/move_module.sh
- $MODULE_SCRIPTS_DIR/get_prestashop.sh
- $MODULE_SCRIPTS_DIR/install_webserver.sh
- $MODULE_SCRIPTS_DIR/start_prestashop.sh
- $MODULE_SCRIPTS_DIR/install_module.sh gamification

script:
- cd $TRAVIS_BUILD_DIR/modules/gamification
- composer cs-fix-test
- composer test

notifications:
email:
on_success: never
on_failure: always
8 changes: 8 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ That's it: you have contributed to this open-source project! Congratulations!
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
[3]: https://help.github.com/articles/using-pull-requests

### Execute the testsuite

This module is shipped with a testsuite using PHPUnit, you need Composer to install the dependencies:

```
composer install
composer test
```
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,22 @@
}
],
"require": {
"php": ">=5.4"
"php": ">=5.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.12",
"phpunit/phpunit": "~5.7",
"mockery/mockery": "^1.2",
"symfony/phpunit-bridge": "^3.4",
"symfony/debug": "^3.4"
},
"config": {
"preferred-install": "dist"
},
"scripts": {
"cs-fix": "@php ./vendor/bin/php-cs-fixer fix .",
"cs-fix-test": "@php ./vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --show-progress=dot .",
"test": "SYMFONY_PHPUNIT_VERSION=5.7 php ./vendor/bin/simple-phpunit"
},
"type": "prestashop-module"
}
Loading

0 comments on commit 6756078

Please sign in to comment.