11SHELL = /bin/sh
22
33DOCKER ?= $(shell which docker)
4- DOCKER_REPOSITORY := graze/php-alpine:7.1-test
5- VOLUME := /opt/ graze/queue
6- VOLUME_MAP := -v $$( pwd ) :${VOLUME}
7- DOCKER_RUN_BASE := ${DOCKER} run --rm -t ${VOLUME_MAP } -w ${VOLUME}
8- DOCKER_RUN := ${DOCKER_RUN_BASE} ${DOCKER_REPOSITORY }
4+ PHP_VER := 7.2
5+ IMAGE := graze/php-alpine:${PHP_VER}-test
6+ VOLUME := /srv
7+ DOCKER_RUN_BASE := ${DOCKER} run --rm -t -v $$( pwd ) :${VOLUME } -w ${VOLUME}
8+ DOCKER_RUN := ${DOCKER_RUN_BASE} ${IMAGE }
99
10- .PHONY : install composer clean help run
11- .PHONY : test lint lint-fix test-unit test-integration test-matrix test-coverage test-coverage-html test-coverage-clover
10+ PREFER_LOWEST ?=
11+
12+ .PHONY : install composer help
13+ .PHONY : test lint lint-fix test-unit test-integration test-matrix test-matrix-lowest
14+ .PHONY : test-coverage test-coverage-html test-coverage-clover
1215
1316.SILENT : help
1417
1518# Building
1619
17- build : # # Download the dependencies
18- make ' composer-install --optimize-autoloader'
20+ build : # # Install the dependencies
21+ build : ensure-composer-file
22+ make ' composer-install --optimize-autoloader --prefer-dist ${PREFER_LOWEST}'
23+
24+ build-update : # # Update the dependencies
25+ build-update : ensure-composer-file
26+ make ' composer-update --optimize-autoloader --prefer-dist ${PREFER_LOWEST}'
1927
20- build-update : # # Update and download the dependencies
21- make ' composer-update --optimize-autoloader '
28+ ensure-composer-file : # Update the composer file
29+ make ' composer-config platform.php ${PHP_VER} '
2230
2331composer-% : # # Run a composer command, `make "composer-<command> [...]"`.
2432 ${DOCKER} run -t --rm \
2533 -v $$(pwd ) :/app:delegated \
2634 -v ~/.composer :/tmp:delegated \
27- composer --no-interaction --prefer-dist $* $(filter-out $@,$(MAKECMDGOALS))
35+ -v ~/.ssh :/root/.ssh:ro \
36+ composer --ansi --no-interaction $* $(filter-out $@,$(MAKECMDGOALS))
2837
2938# Testing
3039
@@ -43,12 +52,15 @@ test-unit: ## Run the unit testsuite.
4352test-integration : # # Run the integration testsuite.
4453 ${DOCKER_RUN} vendor/bin/phpunit --colors=always --testsuite integration
4554
55+ test-matrix-lowest : # # Test all version, with the lowest version
56+ ${MAKE} test-matrix PREFER_LOWEST=' --prefer-lowest --prefer-stable'
57+ ${MAKE} build-update
58+
4659test-matrix : # # Run the unit tests against multiple targets.
47- make DOCKER_REPOSITORY=" php:5.6-alpine" test
48- make DOCKER_REPOSITORY=" php:7.0-alpine" test
49- make DOCKER_REPOSITORY=" php:7.1-alpine" test
50- make DOCKER_REPOSITORY=" php:7.2-alpine" test
51- make DOCKER_REPOSITORY=" hhvm/hhvm:latest" test
60+ ${MAKE} PHP_VER=" 5.6" build-update test
61+ ${MAKE} PHP_VER=" 7.0" build-update test
62+ ${MAKE} PHP_VER=" 7.1" build-update test
63+ ${MAKE} PHP_VER=" 7.2" build-update test
5264
5365test-coverage : # # Run all tests and output coverage to the console.
5466 ${DOCKER_RUN} phpdbg7 -qrr vendor/bin/phpunit --coverage-text
0 commit comments