Skip to content

Commit

Permalink
chore: adjust Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
brotkrueml committed Oct 20, 2024
1 parent f2811fe commit cab24ba
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 24 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ jobs:
composer update --no-progress --prefer-dist --optimize-autoloader
- name: Run PHP linter
run: |
find . -type f -name '*.php' ! -path "./vendor/*" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
make lint-php
- name: Run tests
run: |
make tests
make tests-php-unit
code-quality:
name: Code Quality
runs-on: ubuntu-latest
Expand Down Expand Up @@ -77,16 +77,16 @@ jobs:
- name: Check coding standards
if: always()
run: |
vendor/bin/ecs check --no-progress-bar
make cs-php-check
- name: Run mutation tests
if: always()
run: |
make infection
- name: Run phpstan
make tests-php-mutation
- name: Run static analysis
if: always()
run: |
make phpstan
make stan
- name: Run rector
if: always()
run: |
make rector-dry
make rector-check
58 changes: 41 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
.PHONY: qa
qa: cs tests infection phpstan rector-dry
.PHONY: $(filter-out vendor,$(MAKECMDGOALS))

.PHONY: cs
cs:
vendor/bin/ecs --fix
help:
@printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n"
@grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}'

.PHONY: infection
infection:
vendor/bin/infection --min-msi=92
qa: comp lint stan rector-check tests cs ## Run all relevant code checks

.PHONY: phpstan
phpstan:
vendor/bin/phpstan analyse
comp: comp-check comp-norm ## Validate and normalize composer.json

comp-check: ## Validate composer.json
composer validate

comp-norm: vendor ## Normalize composer.json
composer normalize

cs: cs-php ## Check and fix coding standards

cs-check: cs-php-check ## Only check coding standards

cs-php: vendor ## Check and fix PHP coding standards
vendor/bin/ecs check --fix

cs-php-check: vendor ## Only check PHP coding standards
vendor/bin/ecs check

.PHONY: rector
rector:
lint: lint-php

lint-php: ## Lint PHP files
find . -type f -name '*.php' ! -path "./vendor/*" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

rector: vendor ## Apply rector rules
vendor/bin/rector

.PHONY: rector-dry
rector-dry:
rector-check: vendor ## Only check against rector rules
vendor/bin/rector --dry-run

.PHONY: tests
tests:
stan: vendor ## Run static analysis
vendor/bin/phpstan analyse

tests: tests-php-unit tests-php-mutation ## Run all tests

tests-php-mutation: vendor ## Run PHP unit tests
vendor/bin/infection --min-msi=92

tests-php-unit: vendor ## Run PHP unit tests
vendor/bin/phpunit --configuration=phpunit.xml.dist

vendor: composer.json $(wildcard composer.lock) ## Install PHP dependencies
composer install

0 comments on commit cab24ba

Please sign in to comment.