Last active
January 3, 2018 15:06
-
-
Save fhuitelec/6c0ffd1bd1b0f8281bce449c975b54b5 to your computer and use it in GitHub Desktop.
[Bootstrap PHPUnit] #docker #php #unittests #makefile
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
# ######### # | |
# VARIABLES # | |
# ######### # | |
export PHP_VERSION = 7.1 | |
export PROJECT_NAME = your-project-name | |
# ####### # | |
# TARGETS # | |
# ####### # | |
.PHONY: unit | |
unit: | |
$(MAKE) .inner-tests TEST_SUITE=unit | |
.PHONY: functional | |
functional: | |
$(MAKE) .inner-tests TEST_SUITE=functional | |
.PHONY: tests | |
tests: unit functional | |
.PHONY: .inner-tests | |
.inner-tests: | |
ifdef FILTER | |
$(DOCKER_EXEC) php:${PHP_VERSION}-cli-alpine ./vendor/bin/phpunit --testsuite $(TEST_SUITE) --filter "$(FILTER)" | |
else | |
$(DOCKER_EXEC) php:${PHP_VERSION}-cli-alpine ./vendor/bin/phpunit --testsuite $(TEST_SUITE) | |
endif | |
@echo | |
@echo 'Test documentation available at: ' ${PWD}/var/tests/documentation/testdox.html | |
# ######### # | |
# INTERNALS # | |
# ######### # | |
# Docker partial commands | |
export COMPOSER_COMPOSE_EXEC = docker-compose -f infrastructure/dev/composer.docker-compose.yaml | |
export DOCKER_EXEC = docker run -ti --rm --name ${PROJECT_NAME} --volume ${PWD}:/app --workdir /app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment