-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
25 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
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,38 +1,34 @@ | ||
# If the first argument is "composer"... | ||
ifeq (composer, $(firstword $(MAKECMDGOALS))) | ||
# use the rest as arguments for "composer" | ||
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) | ||
# ...and turn them into do-nothing targets | ||
$(eval $(RUN_ARGS):;@:) | ||
endif | ||
current_user := $(shell id -u) | ||
current_group := $(shell id -g) | ||
BUILD_DIR := $(PWD) | ||
DOCKER_FLAGS := --interactive --tty | ||
DOCKER_IMAGE := wikimediade/fundraising-frontend | ||
|
||
.PHONY: ci test phpunit cs stan covers composer validate-composerfile | ||
install-php: | ||
docker run --rm $(DOCKER_FLAGS) --volume $(BUILD_DIR):/app -w /app --volume ~/.composer:/composer --user $(current_user):$(current_group) $(DOCKER_IMAGE):composer composer install $(COMPOSER_FLAGS) | ||
|
||
ci: test cs validate-composerfile | ||
update-php: | ||
docker run --rm $(DOCKER_FLAGS) --volume $(BUILD_DIR):/app -w /app --volume ~/.composer:/composer --user $(current_user):$(current_group) $(DOCKER_IMAGE):composer composer update $(COMPOSER_FLAGS) | ||
|
||
test: covers phpunit | ||
ci: covers phpunit cs stan | ||
|
||
cs: phpcs stan | ||
test: covers phpunit | ||
|
||
fix-cs: | ||
docker-compose run --rm --no-deps app ./vendor/bin/phpcbf | ||
covers: | ||
docker-compose run --rm app ./vendor/bin/covers-validator | ||
|
||
phpunit: | ||
docker-compose run --rm app ./vendor/bin/phpunit | ||
|
||
phpcs: | ||
cs: | ||
docker-compose run --rm app ./vendor/bin/phpcs | ||
|
||
stan: | ||
docker-compose run --rm app ./vendor/bin/phpstan analyse --level=5 --no-progress src/ tests/ | ||
fix-cs: | ||
docker-compose run --rm app ./vendor/bin/phpcbf | ||
|
||
covers: | ||
docker-compose run --rm app ./vendor/bin/covers-validator | ||
stan: | ||
docker-compose run --rm app ./vendor/bin/phpstan analyse --level=1 --no-progress src/ tests/ | ||
|
||
validate-composerfile: | ||
docker run --rm --interactive --tty --volume $(shell pwd):/app -w /app\ | ||
--volume ~/.composer:/composer --user $(shell id -u):$(shell id -g) wikimediade/fundraising-frontend:composer composer validate --no-interaction | ||
setup: install-php | ||
|
||
composer: | ||
docker run --rm --interactive --tty --volume $(shell pwd):/app -w /app\ | ||
--volume ~/.composer:/composer --user $(shell id -u):$(shell id -g) wikimediade/fundraising-frontend:composer composer --no-scripts $(filter-out $@,$(MAKECMDGOALS)) | ||
.PHONY: install-php update-php ci test covers phpunit cs fix-cs stan setup |