Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Commit

Permalink
Merge branch 'feature/makefile' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Aug 1, 2016
2 parents 2287919 + 85aab3e commit 2151df6
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 40 deletions.
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
build
vendor
resources
phpunit.xml
phpunit-*.xml
composer.lock
/build
/vendor
/phpunit.xml
/composer.lock
25 changes: 17 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@ php:
- 5.5
- 5.6
- 7.0
- '7.1.0alpha1'
- hhvm

matrix:
fast_finish: true
allow_failures:
- php: '7.1.0alpha1'
- php: hhvm
include:
- php: 5.6
env: XDEBUG_OFF="yes"
- php: 7.0
env: XDEBUG_OFF="yes"

script:
- composer update-all
- composer test
before_script:
- if [[ $XDEBUG_OFF = yes ]]; then phpenv config-rm xdebug.ini; fi;

# Visual tests
- php ./bin/jbzoo
- php ./bin/jbzoo test --option=ytrewq
script:
- make
- make test-all

after_script:
- composer coveralls
after_success:
- make coveralls
84 changes: 84 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#
# JBZoo Console
#
# This file is part of the JBZoo CCK package.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Console
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Console
#

.PHONY: build update test-all validate autoload test phpmd phpcs phpcpd phploc reset coveralls

build: update

test-all:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Run all tests \033[0m"
@make validate test phpmd phpcs phpcpd phploc

update:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Update project \033[0m"
@composer update --optimize-autoloader --no-interaction
@echo ""

validate:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Composer validate \033[0m"
@composer validate --no-interaction
@echo ""

autoload:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Composer autoload \033[0m"
@composer dump-autoload --optimize --no-interaction
@echo ""

test:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Run unit-tests \033[0m"
@php ./vendor/phpunit/phpunit/phpunit --configuration ./phpunit.xml.dist
@php ./bin/jbzoo
@php ./bin/jbzoo test --option=ytrewq
@echo ""

test-x:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Run unit-tests with XDebug \033[0m"
@php-x ./vendor/phpunit/phpunit/phpunit --configuration ./phpunit.xml.dist --verbose
@echo ""

phpmd:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Check PHPmd \033[0m"
@php ./vendor/phpmd/phpmd/src/bin/phpmd ./src text \
./vendor/jbzoo/misc/phpmd/jbzoo.xml --verbose

phpcs:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Check Code Style \033[0m"
@php ./vendor/squizlabs/php_codesniffer/scripts/phpcs ./src \
--extensions=php \
--standard=./vendor/jbzoo/misc/phpcs/JBZoo/ruleset.xml \
--report=full
@echo ""

phpcpd:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Check Copy&Paste \033[0m"
@php ./vendor/sebastian/phpcpd/phpcpd ./src --verbose
@echo ""

phploc:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Show stats \033[0m"
@php ./vendor/phploc/phploc/phploc ./src --verbose
@echo ""

reset:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Hard reset \033[0m"
@git reset --hard

clean:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Cleanup project \033[0m"
@rm -rf ./vendor/
@rm -f ./composer.lock

coveralls:
@echo -e "\033[0;33m>>> >>> >>> >>> >>> >>> >>> >>> \033[0;30;46m Send coverage to coveralls.io \033[0m"
@php ./vendor/satooshi/php-coveralls/bin/coveralls --verbose
@echo ""
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
[![License](https://poser.pugx.org/JBZoo/Console/license)](https://packagist.org/packages/JBZoo/Console)
[![Latest Stable Version](https://poser.pugx.org/JBZoo/Console/v/stable)](https://packagist.org/packages/JBZoo/Console) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/JBZoo/Console/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/JBZoo/Console/?branch=master)

### License

## Unit tests and check code style
```sh
make
make test-all
```


## License

MIT
26 changes: 1 addition & 25 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"symfony/process" : "^2.8|^3.0"
},
"require-dev" : {
"jbzoo/phpunit" : "^1.2.3"
"jbzoo/phpunit" : "^1.7|1.x-dev"
},
"autoload" : {
"psr-4" : {
Expand All @@ -37,30 +37,6 @@
"config" : {
"optimize-autoloader" : true
},
"scripts" : {
"test" : [
"@manifest",
"@autoload",
"@phpunit",
"@phpmd",
"@phpcs",
"@phpcpd",
"@phploc"
],
"update-all" : [
"composer self-update --no-interaction",
"composer update --no-interaction --optimize-autoloader"
],
"git-reset" : "git reset --hard",
"manifest" : "composer validate --no-interaction",
"autoload" : "composer dump-autoload --optimize --no-interaction",
"phpunit" : "php ./vendor/phpunit/phpunit/phpunit --configuration ./phpunit.xml.dist",
"phpmd" : "php ./vendor/phpmd/phpmd/src/bin/phpmd ./src text ./vendor/jbzoo/misc/phpmd/jbzoo.xml --verbose",
"phpcs" : "php ./vendor/squizlabs/php_codesniffer/scripts/phpcs ./src --standard=./vendor/jbzoo/misc/phpcs/JBZoo/ruleset.xml --report=full",
"phpcpd" : "php ./vendor/sebastian/phpcpd/phpcpd ./src --verbose",
"phploc" : "php ./vendor/phploc/phploc/phploc ./src --verbose",
"coveralls" : "php ./vendor/satooshi/php-coveralls/bin/coveralls --verbose"
},
"support" : {
"issues" : "https://github.com/JBZoo/Console/issues"
}
Expand Down

0 comments on commit 2151df6

Please sign in to comment.