Skip to content

Commit

Permalink
Merge pull request #211 from akeneo/API-1693-create-a-makefile-for-ap…
Browse files Browse the repository at this point in the history
…i-php-client

API-1693 - Create a Makefile
  • Loading branch information
LevFlavien authored Jan 20, 2022
2 parents a95d931 + 005e360 commit 9cef633
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
DOCKER_RUN = docker-compose run client_72

.PHONY: help
help:
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'

.PHONY: dependencies
dependencies: ## Install composer dependencies
cp docker-compose.yml.dist docker-compose.yml
rm -rf composer.lock vendor/
$(DOCKER_RUN) composer install

.PHONY: tests
tests: ## Run PHPUnit & PHPSpec tests, and code style check
@echo "-----------"
@echo "- PHPUnit -"
@echo "-----------"
$(DOCKER_RUN) bin/phpunit -c phpunit.xml.dist
@echo ""
@echo "-----------"
@echo "- PHPSpec -"
@echo "-----------"
$(DOCKER_RUN) bin/phpspec run
@echo "------------------"
@echo "- PHP code style -"
@echo "------------------"
$(DOCKER_RUN) bin/php-cs-fixer fix --diff --dry-run --config=.php_cs.php -vvv

.PHONY: fix-cs
fix-cs: ## Fix PHP code style
$(DOCKER_RUN) bin/php-cs-fixer fix --config=.php_cs.php
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ docker-compose run client_72 bin/phpspec run
docker-compose run client_72 bin/php-cs-fixer fix --diff --dry-run --config=.php_cs.php -vvv
```

Or use `make`:

```
make dependencies
make tests
```

## Support

The support of this client is made in best effort by our Akeneo team.
Expand Down

0 comments on commit 9cef633

Please sign in to comment.