-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing and improve readability of .PHONY declarations for Makefi…
…le targets elifesciences/issues#9146
- Loading branch information
Showing
1 changed file
with
7 additions
and
1 deletion.
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,28 +1,34 @@ | ||
PROJECT_NAME = patterns-php | ||
.PHONY: build lint phpcs test test-ci update-pattern-library | ||
|
||
vendor: | ||
composer install | ||
|
||
.PHONY: test | ||
test: vendor | ||
vendor/bin/phpunit | ||
|
||
.PHONY: phpcs | ||
phpcs: | ||
vendor/bin/phpcs --standard=phpcs.xml.dist --warning-severity=0 -p bin src tests | ||
|
||
.PHONY: lint | ||
lint: phpcs | ||
find src tests -name '*.php' | xargs -L1 php -l | ||
|
||
.PHONY: update-pattern-library | ||
update-pattern-library: | ||
bin/update | ||
|
||
.PHONY: build | ||
build: | ||
$(if $(PHP_VERSION),,$(error PHP_VERSION make variable needs to be set)) | ||
docker buildx build --build-arg=PHP_VERSION=$(PHP_VERSION) -t $(PROJECT_NAME):$(PHP_VERSION) . | ||
|
||
.PHONY: lint-ci | ||
lint-ci: build | ||
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'vendor/bin/phpcs --standard=phpcs.xml.dist --warning-severity=0 -p bin src tests' | ||
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'find src tests -name '*.php' | xargs -L1 php -l' | ||
|
||
.PHONY: test-ci | ||
test-ci: build | ||
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'vendor/bin/phpunit' |