-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modernise the development environment a bit (Guzzle 5) (#31)
* update guzzle-5 branch with docker * support php 5.4 * update README * add make help target * update makefile and .gitignore file * add composer.lock file * tidy up README
- Loading branch information
Harry Bragg
authored
Dec 13, 2017
1 parent
5bd9f07
commit 0ecddea
Showing
22 changed files
with
1,875 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
.pid | ||
.vagrant | ||
composer.lock | ||
phpunit.xml | ||
test/server/node_modules | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,39 @@ | ||
language: php | ||
|
||
sudo: false | ||
dist: trusty | ||
|
||
php: | ||
cache: | ||
directories: | ||
- $HOME/.composer/cache/files | ||
- $HOME/.npm | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7 | ||
- 7.1 | ||
- hhvm | ||
- hhvm-nightly | ||
- nightly | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm | ||
- php: hhvm-nightly | ||
- php: nightly | ||
fast_finish: true | ||
|
||
before_install: | ||
- sudo apt-get update | ||
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce | ||
|
||
before_script: | ||
- ~/.nvm/nvm.sh install v0.10.32 | ||
- ~/.nvm/nvm.sh run v0.10.32 | ||
- make | ||
- make deps-js | ||
- travis_retry composer update --no-interaction | ||
|
||
script: | ||
- make test | ||
- vendor/bin/phpcs -p --warning-severity=0 --ignore=test/server src/ test/ | ||
- vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover --testsuite unit | ||
- make test-functional | ||
|
||
after_script: | ||
- test -f ./tests/report/coverage.clover && (wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./tests/report/coverage.clover) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,52 @@ | ||
NJS := `which node` | ||
PWD := `pwd` | ||
PID := $(PWD)/.pid | ||
.PHONY: deps deps-js deps-php help | ||
.PHONY: lint test test-unit test-functional test-coverage test-coverage-clover | ||
.PHONY: server-start server-stop | ||
|
||
.PHONY: cs test | ||
|
||
all: deps | ||
deps: ## Install all dependencies | ||
deps: deps-php deps-js | ||
|
||
cs: | ||
@vendor/bin/php-cs-fixer fix src | ||
deps-js: ## Install javascript dependencies | ||
@docker-compose run --rm node yarn install | ||
|
||
deps: deps-php deps-js | ||
deps-php: ## Install php dependencies | ||
@docker-compose run --rm composer install --prefer-dist | ||
|
||
deps-js: | ||
@cd test/server && npm install | ||
|
||
deps-php: | ||
@composer install | ||
server-start: ## Start the test server | ||
@docker-compose up -d node | ||
|
||
server-start: | ||
@start-stop-daemon -S -b -m -o -p $(PID) -d $(PWD)/test/server -x $(NJS) -- index.js | ||
server-stop: ## Stop the test server | ||
@docker-compose stop node | ||
|
||
server-stop: | ||
@start-stop-daemon -K -p $(PID) | ||
|
||
lint: ## Run phpcs against the code. | ||
@docker-compose run --rm test vendor/bin/phpcs -p --warning-severity=0 --ignore=test/server src/ test/ | ||
|
||
test: ## Run all the tests | ||
test: test-unit test-functional | ||
|
||
test-functional: ## Test the functionality | ||
test-functional: server-start | ||
@vendor/bin/phpunit --testsuite functional | ||
@$(MAKE) server-stop | ||
@docker-compose run --rm test vendor/bin/phpunit --testsuite functional | ||
@${MAKE} server-stop | ||
|
||
test-unit: ## Test the units | ||
@docker-compose run --rm test vendor/bin/phpunit --testsuite unit | ||
|
||
test-coverage: ## Run all tests and output coverage to the console. | ||
test-coverage: server-start | ||
@docker-compose run --rm test phpdbg7 -qrr vendor/bin/phpunit --coverage-text | ||
@${MAKE} server-stop | ||
|
||
test-coverage-clover: ## Run all tests and output clover coverage to file. | ||
test-coverage-clover: server-start | ||
@docker-compose run --rm test phpdbg7 -qrr vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover | ||
@${MAKE} server-stop | ||
|
||
|
||
test-unit: | ||
@vendor/bin/phpunit --testsuite unit | ||
help: ## Show this help message. | ||
@echo "usage: make [target] ..." | ||
@echo "" | ||
@echo "targets:" | ||
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.